unit3.online registration form tricks: input field box align right and placeholder text right, but input text left.

TrickA:
align the input field box to right



1. make the input field to right 
the trick is: not float input field to right, you need to give the label margin-right:auto; then push the input field to right

    .container label{
        margin-right:auto;
}

2. but after that, the label is not level with input filed.



you have to fix it with:

.container label{
    justify-content:center;
    align-self:center;
}

then you will see the perfect picture:

3. but not end, you will find new issue:

the postcode area is also pushed to right, and the project require the postcode field short than others.
you will need a little math to fix it:
for example: 
your input area width is 80%; 
label is 15%, 
100-80-15=5
then you can set 5% between by:
label[for="postcode"]{
margin-right:5%
}
after that, you will get perfect picture.


TrickB
the place holder text showing on the right.


you can simply align the text to right by:
input[placeholder]{
    text-align:right;
}
but when you click the input filed, you will find the user has to type from right side, not start from left side.

you can fixed it by:
input:focus{
    text-align:left;
}


Well done, good job!










Comments

Popular posts from this blog

how to code a weather forecast web

What Build Tools Do JavaScript Developers Use?

how to use :focus

Numbers in JavaScript introduction

WordPress Theme Development From Scratch - 3. Enqueuing CSS and JS to W...

review: Add Form Labels task3