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
Well done, good job!
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.
.container label{
justify-content:center;
align-self:center;
}
then you will see the perfect picture:
then you will see the perfect picture:
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.
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
Post a Comment