Link to home
Start Free TrialLog in
Avatar of panJames
panJames

asked on

CSS, web page formatting

Hello experts!

Please have a look at this code:


HTML

<form method="post" action="">
    <fieldset>
        <ol>
            <li class="email">
                <label for="email" >Email:</label>
                <input type="text" align="left"  id="email" name="email" title="Email address"/>
           
            </li>


CSS

fieldset {
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #CCC;
}


   
    fieldset label {
        float:left;
   
        display: block;
      }


   
    fieldset input[type="text"], input[type="password"] {
        border: 1px solid #ccc;
        padding: 2px;
        font-size: 1.2em;
        color: #444;
        width: 300px;
        float:left;
    }

What I want to achieve is to position my label and input field in one row, next to each other, nicely positioned with proper horizontal distances.

How can I do it?

Thank you!

panJames
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial