0

The placeholder text appears vertically aligned in the center which is fine with the Name and email fields but not with the Text field. I want it to be aligned to the top (the height of the text field is 100px).

Here is the CSS I've used:

form {
    width: 500px;
    margin: 0 auto;
}

input {
    font-weight: 300;
    font-family: 'Open Sans', sans-serif;
    border-radius: 5px;
    padding: 10px;
}

input[type="text"] {
    display: block;
    margin: auto;
    margin-bottom: 15px;
    width: 250px;
    border: 1px solid lightgrey;
}

input[type="submit"] {
    display: block;
    margin: auto;
    width: 272px;
    height: 40px;
    border: none;
    background: steelblue;
    color: white;
}

input[class="text-field"] {
    height: 100px;
}
1
  • could you post your HTML too pls
    – web-tiki
    Apr 14, 2014 at 19:48

1 Answer 1

1

I'm assuming you want this text field to contain multi-line text (since you're setting its height to 100px), in which case you might want to use a <textarea> instead. The switch should solve your vertical alignment problem.

1
  • It works. I thought <input> was the default/standard way to go. Thanks
    – Saad Aleem
    Apr 14, 2014 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.