midrange.com code scratchpad |
Name:
css_positioning.html
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
06/05/2008 06:34:03 pm
|
IP:
Logged
|
|
Description:
Shows how to position fields with properties vs. using HTML tables, tr, and td tags.
|
Code:
- <html>
- <head>
- <style type="css">
- p.lblFld {
- clear: both;
- float: none;
- position: relative;
- }
-
- p.lblFld input {
- clear: left;
- float: left;
- margin-left: 80px;
- }
-
- p.lblFld label {
- clear: left;
- display: block;
- float: left;
- margin-left: 10px;
- width: 200px;
- }
- </style>
-
- </head>
-
- <body>
-
- <div id="screen1">
- <p class="lblFld">
- <label for="cust_fnam">First Name</label>
- <input type="text" id="cust_fnam" />
- </p>
- <p class="lblFld">
- <label for="cust_lnam">Last Name</label>
- <input type="text" id="cust_lnam" />
- </p>
- <p class="lblFld">
- <label for="cust_acct">Account</label>
- <input type="text" id="cust_acct" />
- </p>
-
- </div>
-
-
- </body>
- </html>
|
|
|