I am trying to style - newsletter - input - submit so that when you see the web in your phone the three elements show up one under the other- and all the boxes in the same size and align.
Does anyone have an easy solution for this? Ill appreciate your help very much. Regards and thanks! http://vtwg.eu/michael/index.html
V
<div id="contact-area">
<form method="post" action="contactengine.php">
<label for="Name">NEWSLETTER</label>
<input type="text" name="Name" id="Name" />
<input type="submit" name="submit" value="SUBMIT" class="submit-button" />
</form>
</div>
input {
padding: 5px;
width: 120px;
font-family: arial, sans-serif;
font-size: 1em;
margin: 0px 0px 4px 0px;
border: 3px solid black;
background: white;
}
.submit-button {
float: center;
font-size: 1em;
}
label {
font-family: arial;
text-align: center;
width: 120px;
padding: 5.5px;
background:#57007F;
border: 3px solid black;
margin-left: 20px;
}
If you want to change design elements for mobie view, you should use media query. In the snippet media query set to max-width of viewport equal 480px. You can change this value as you wish. When you narrow browser window
down to less than 480px, you'll see the diference.
input {
display: inline-block;
padding: 5px;
width: 120px;
font-family: arial, sans-serif;
font-size: 1em;
margin: 0px 0px 4px 0px;
border: 3px solid black;
background: white;
}
.submit-button {
font-size: 1em;
display: inline-block;
}
label {
font-family: arial;
text-align: center;
width: 120px;
padding: 5.5px;
background:#57007F;
border: 3px solid black;
margin-left: 20px;
display: inline-block;
}
#media screen and (max-width: 480px) {
input, .submit-button, label {
display: block;
width: 120px;
margin: 5px;
box-sizing: border-box;
}
}
<div id="contact-area">
<form method="post" action="contactengine.php">
<label for="Name">NEWSLETTER</label>
<input type="text" name="Name" id="Name" />
<input type="submit" name="submit" value="SUBMIT" class="submit-button" />
</form>
</div>
Write styles in media query with respect to the resolution.
HTML:
<div id="contact-area">
<form method="post" action="contactengine.php">
<label for="Name">NEWSLETTER</label>
<input type="text" name="Name" id="Name" />
<input type="submit" name="submit" value="SUBMIT" class="submit-button" />
</form>
</div>
CSS:
input {
padding: 5px;
width: 120px;
font-family: arial, sans-serif;
font-size: 1em;
margin: 0px 0px 4px 0px;
border: 3px solid black;
background: white;
}
.submit-button {
float: center;
font-size: 1em;
}
label {
font-family: arial;
text-align: center;
width: 120px;
padding: 5.5px;
background:#57007F;
border: 3px solid black;
margin-left: 20px;
}
#media only screen and (max-width: 767px) {
label,
#Name,
.submit-button
{
width: 100%;
display: block;
margin: 5px 0;
box-sizing: border-box;
}
}
Related
Can anyone help me? I tried to add a border-color using :focus on the form input when the user clicks on the text field. But it doesn't work. Any help is really appreciated. Thank you!
form.customNewsletter-form {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: flex-start;
margin: 0;
padding: 0;
gap: 16px;
}
form.customNewsletter-form input[type="text"] {
font-family: "Roboto", sans-serif;
font-size: 16px;
font-weight: 300;
color: #ffffff;
background-color: #0d0d0d;
border: 1px solid #404040;
width: 70%;
height: 48px;
padding: 0 16px;
letter-spacing: 0.8px;
border-radius: 4px;
margin: 0;
}
form.customNewsletter-form input[type="text"]:focus {
border: 1px solid #cd0d0d;
}
form.customNewsletter-form input::placeholder {
color: #8d8d8d;
}
form.customNewsletter-form input[type="submit"] {
color: #ffffff;
font-family: "Roboto Condensed", sans-serif;
font-size: 16px;
font-weight: 300;
background-color: #cd0d0d;
border: none;
border-radius: 4px;
height: 48px !important;
width: 30%;
letter-spacing: 0.8px;
text-transform: uppercase;
margin: 0 auto !important;
transition: 0.3s all ease;
}
form.customNewsletter-form input[type="submit"]:hover {
background-color: #8e0000;
color: #ffffff;
-webkit-transform: scale(0.99);
transform: scale(0.99) 0.5s ease-in;
}
<form class="customNewsletter-form" action="https://app.getresponse.com/add_subscriber.html" accept-charset="utf-8" method="post">
<!-- Email field (required) -->
<input type="text" name="email" placeholder="Enter your email">
<!-- List token -->
<!-- Get the token at: https://app.getresponse.com/campaign_list.html -->
<input type="hidden" name="campaign_token" value="sample">
<!-- Thank you page (optional) -->
<input type="hidden" name="thankyou_url" value="https://www.website.com/thankyou">
<!-- Add subscriber to the follow-up sequence with a specified day (optional) -->
<input type="hidden" name="start_day" value="0">
<!-- Subscriber button -->
<input type="submit" value="Subscribe">
</form>
Please see here for the demo.
I'm expecting the border-color of the input field to change to red when the user clicks on it.
Add outline:none;
form.customNewsletter-form input[type="text"]:focus {
outline: none;
border: 1px solid #cd0d0d;
}
i have a React code that is doing simple form:
return (
<form onSubmit={handleSubmit} className="login-form">
<label>
Username:
<input
type="text"
value={username}
onChange={(event) => setUsername(event.target.value)}
className="input"
/>
</label>
<br />
<label>
Password:
<input
type="password"
value={password}
onChange={(event) => setPassword(event.target.value)}
className="input"
/>
</label>
<br />
<button type="submit" className="button">Login</button>
</form>
The fact is when i'm styling this code i get the witdh button is greater than inputs but i don't understand what i'm doing bad, because its giving 100% width in both elements.
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-color: #f1f1f1;
}
.login-form {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
padding: 20px;
flex-direction: column;
background-color: white;
box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.1);
}
.label {
font-size: 18px;
font-weight: bold;
margin-bottom: 5px;
}
.input {
padding: 10px;
font-size: 18px;
border: 1px solid #ddd;
display: block;
margin-bottom: 10px;
width: 100%;
}
.button {
padding: 10px 20px;
font-size: 18px;
background-color: #4caf50;
color: white;
border: none;
cursor: pointer;
width: 100%;
}
So, what i'm doing wrong? I thought the button width 100% would have been adapt to class form
Example:
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-color: #f1f1f1;
display: flex;
justify-content: center;
}
.login-form {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
padding: 20px;
flex-direction: column;
background-color: white;
box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.1);
width: min-content;
}
.label {
font-size: 18px;
font-weight: bold;
margin-bottom: 5px;
}
.input {
padding: 10px;
font-size: 18px;
border: 1px solid #ddd;
display: block;
margin-bottom: 10px;
}
.button {
padding: 10px 20px;
font-size: 18px;
background-color: #4caf50;
color: white;
border: none;
cursor: pointer;
width: 100%;
}
<form onSubmit={handleSubmit} class="login-form">
<label>Username:
<input type="text"
class="input"/>
</label>
<br />
<label>Password:
<input type="password"
class="input"/>
</label>
<br />
<button type="submit" class="button">Login</button>
</form>
I want to move the "Not got account" submit button to below the form but not sure what I am doing wrong
I think it is the CSS for .box but not sure how to edit it so it moves the button below and I tried using div tags to move it and they did not work.
Is there a bit of code in my CSS that is keeping it in the centre
I would like to keep it in the same style
Any help would be greatly appreiated
* {
box-sizing: border-box;
}
html {
background: #191919;
}
body {
background: #191919, #f5f5f5;
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
text-align: center;
font-weight: 100;
width 100vw;
height 100vh;
}
.box {
width: 400px;
padding: 40px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #191919;
text-align: center;
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="text"],
.box input[type="password"] .box input[type="email"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="text"]:focus,
.box input[type="password"]:focus .box input[type="email"]:focus {
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover {
background: #2ecc71;
}
<html>
<form class="box" action="login.php" method="post">
<h1>Login</h1>
<input type="text" name="u_email" placeholder="Email">
<input type="password" name="u_pass" placeholder="Password">
<input type="submit" name="u_btn" value="Login">
</form>
<div id="right-bar">
<form class="box" action="register.php" method="POST">
<input type="submit" name="" value="Not got an Account?">
</form>
</div>
</html>
This is because the 2nd form uses the same class box which centers the element with the first one.
.box {
...
top: 50%; <--- this is the problem
left: 50%;
...
}
* {
box-sizing: border-box;
}
html {
background: #191919;
}
body {
background: #191919, #f5f5f5;
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
text-align: center;
font-weight: 100;
width 100vw;
height 100vh;
}
.box {
width: 400px;
padding: 40px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #191919;
text-align: center;
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="text"],
.box input[type="password"] .box input[type="email"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="text"]:focus,
.box input[type="password"]:focus .box input[type="email"]:focus {
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover {
background: #2ecc71;
}
.box2 {
padding: 0px;
top: 90%;
}
<html>
<form class="box" action="login.php" method="post">
<h1>Login</h1>
<input type="text" name="u_email" placeholder="Email">
<input type="password" name="u_pass" placeholder="Password">
<input type="submit" name="u_btn" value="Login">
</form>
<div id="right-bar">
<form class="box box2" action="register.php" method="POST">
<input type="submit" name="" value="Not got an Account?">
</form>
</div>
</html>
Just don't position your boxes absolute. Makes it quite difficult to get the positioning right.
* {
box-sizing: border-box;
}
html {
background: #191919;
}
body {
background: #191919, #f5f5f5;
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
text-align: center;
font-weight: 100;
width 100vw;
height 100vh;
}
.box {
width: 400px;
padding: 40px;
margin: 0 auto;
background: #191919;
text-align: center;
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="text"],
.box input[type="password"] .box input[type="email"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="text"]:focus,
.box input[type="password"]:focus .box input[type="email"]:focus {
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover {
background: #2ecc71;
}
<html>
<form class="box" action="login.php" method="post">
<h1>Login</h1>
<input type="text" name="u_email" placeholder="Email">
<input type="password" name="u_pass" placeholder="Password">
<input type="submit" name="u_btn" value="Login">
</form>
<div id="right-bar">
<form class="box" action="register.php" method="POST">
<input type="submit" name="" value="Not got an Account?">
</form>
</div>
</html>
Not sure if this is what you are looking for, but position absolute in your form is not the best use in this case. You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/CSS/position
Anyway, I made some adjustments in your code: I added a div container for the whole page and made some changes in your css as well. You can check it out in the demo below.
* {
box-sizing: border-box;
}
html {
background: #191919;
}
body {
background: #191919, #f5f5f5;
margin: 0;
padding: 0;
font-family: "Lato", sans-serif;
text-align: center;
font-weight: 100;
width: 100vw;
height: 100vh;
}
.main-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.box {
margin-top: 10%;
width: 400px;
padding: 40px;
/* position: absolute; */
/* top: 50%;
left: 50%; */
/* transform: translate(-50%, -50%); */
background: #191919;
text-align: center;
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="text"],
.box input[type="password"] .box input[type="email"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 200px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="text"]:focus,
.box input[type="password"]:focus .box input[type="email"]:focus {
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover {
background: #2ecc71;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="main-container">
<form class="box" action="login.php" method="post">
<h1>Login</h1>
<input type="text" name="u_email" placeholder="Email" />
<input type="password" name="u_pass" placeholder="Password" />
<input type="submit" name="u_btn" value="Login" />
</form>
<div id="right-bar">
<form class="box" action="register.php" method="POST">
<input type="submit" name="" value="Not got an Account?" />
</form>
</div>
</div>
</body>
</html>
I have a form and i want it positioned directly under the logo that
is positioned in the middle of the page. So far, i cant seem to do
more than this. Any help will be appreciated. Thanx.
Thie is HTML code:
<html>
<body>
<div id="content">
<div id="formwrapper">
<div id="image">
<img src="infiniteflame.jpg" width="200"height="100">
</div>
<div id="form">
<form>
<fieldset class="account-info">
<label>
Email Address
<input type="text" name="username">
</label>
<label>
Password
<input type="password" name="password">
</label>
</fieldset>
<fieldset class="account-action">
<input class="btn" type="submit" name="submit" value="Login">
-----OR----
<input class="btn" type="submit" name="submit" value="Login via facebook">
<div id="lang_pref">
<ul>
<li>English</li>
<li>العربية</li>
<li>čeština</li>
<li>dansk</li>
<li>Deutsch</li>
<li>Ελληνικά</li>
<li>español</li>
<li>español latinoamericano</li>
</ul>
</div>
</fieldset>
</form>
</div>
</div>
<footer>
<div class="copyright"><img src="infiniteflame.jpg" width="15" height="20" align="middle"><br/>Copyright© 2016 PopeeSoft Solutions, Inc.</div>
</footer>
</div>
</body>
</html>
This is CSS Code:
*,
*:before,
*:after {
box-sizing: border-box;
}
#content {
width: auto;
margin: auto;
border:1px solid #00C;
}
#formwrapper{
width: 1200px;
margin: auto;
height: 900px;
border:1px solid #00C;
}
#image {
position: fixed;
top: 50%;
left: 50%;
margin-top: -208px;
margin-left: -155px;
}
footer {
background: #eee;
}
form {
border: 1px solid #c6c7cc;
border-radius: 5px;
font: 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
overflow: hidden;
width: 350px;
}
fieldset {
border: 0;
margin: 0;
padding: 0;
}
input {
border-radius: 5px;
font: 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0;
width:349px;
}
.account-info {
padding: 20px 20px 0 20px;
}
.account-info label {
color: #395870;
display: block;
font-weight: bold;
margin-bottom: 20px;
}
.account-info input {
background: #fff;
border: 1px solid #c6c7cc;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .1);
color: #636466;
padding: 6px;
margin-top: 6px;
width: 100%;
}
.account-action {
background: #f0f0f2;
border-top: 1px solid #c6c7cc;
padding: 20px;
}
.account-action .btn {
background: linear-gradient(#49708f, #293f50);
border: 0;
color: #fff;
cursor: pointer;
font-weight: bold;
float: left;
padding: 8px 16px;
}
.account-action label {
color: #7c7c80;
font-size: 12px;
float: left;
margin: 10px 0 0 20px;
}
ul li{
list-style-type:none;
display: inline;
}
A bit of #image id changes solved the issue
<body>
<div id="content">
<div id="formwrapper">
<div id="image" align="center">
<img src="infiniteflame.jpg" width="200" height="100">
</div>
<div id="form" align="center">
<form>
<fieldset class="account-info">
<label>
Email Address
<input type="text" name="username">
</label>
<label>
Password
<input type="password" name="password">
</label>
</fieldset>
<fieldset class="account-action">
<input class="btn" type="submit" name="submit" value="Login"> -----OR----
<input class="btn" type="submit" name="submit" value="Login via facebook">
<div id="lang_pref">
<ul>
<li>English</li>
<li>العربية</li>
<li>čeština</li>
<li>dansk</li>
<li>Deutsch</li>
<li>Ελληνικά</li>
<li>español</li>
<li>español latinoamericano</li>
</ul>
</div>
</fieldset>
</form>
</div>
</div>
<footer>
<div class="copyright"><img src="infiniteflame.jpg" width="15" height="20" align="middle">
<br/>Copyright© 2016 PopeeSoft Solutions, Inc.</div>
</footer>
</div>
</body>
This is CSS:
#charset "utf-8";
/* CSS Document */
*,
*:before,
*:after {
box-sizing: border-box;
}
#content {
width: 100%;
margin: auto;
border: 1px solid #00C;
}
#formwrapper {
width: 100%;
margin: auto;
height: 900px;
border: 1px solid #00C;
}
footer {
background: #eee;
}
form {
border: 1px solid #c6c7cc;
border-radius: 5px;
font: 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
overflow: hidden;
width: 350px;
}
fieldset {
border: 0;
margin: 0;
padding: 0;
}
input {
border-radius: 5px;
font: 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0;
width: 349px;
}
.account-info {
padding: 20px 20px 0 20px;
}
.account-info label {
color: #395870;
display: block;
font-weight: bold;
margin-bottom: 20px;
}
.account-info input {
background: #fff;
border: 1px solid #c6c7cc;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .1);
color: #636466;
padding: 6px;
margin-top: 6px;
width: 100%;
}
.account-action {
background: #f0f0f2;
border-top: 1px solid #c6c7cc;
padding: 20px;
}
.account-action .btn {
background: linear-gradient(#49708f, #293f50);
border: 0;
color: #fff;
cursor: pointer;
font-weight: bold;
float: left;
padding: 8px 16px;
}
.account-action label {
color: #7c7c80;
font-size: 12px;
float: left;
margin: 10px 0 0 20px;
}
ul li {
list-style-type: none;
display: inline;
}
I need to align labels and inputs of my form using CSS. The result should be something like this (I hope this simple scheme is clear):
Label1: ______
Labellll2: ______
Button
So, my HTML and CSS look as follows. The problem is that labels are placed on top of inputs, and also the button is on the right side instead of a bottom.
<form width="200px" name="optform" method="post" action="#">
<div class = "boxx">
<label for="param1">Param1:</label>
<input type="text" class="input-text" value="5" size="11" maxlength="11" name="param1" id="param1">
<label for="param2">Param1:</label>
<input type="text" class="input-text" value="5" size="11" maxlength="11" name="param2" id="param2">
</div>
<div class="buttons">
<a href="#">
<img src="images/opt.png" alt=""/> Run
</a>
</div>
div.boxx {
width: 500px;
}
div.boxx .input-text{
border:1px solid #A9C7F5;
color: #00557F;
font: 12px Arial;
float:left;
width:66%;
margin:0 0 0.5em 0.25em;
}
div.boxx label{
display:block;
font: 13px Arial;
color:#00557F;
width:33%;
float:left;
text-align:left;
padding-right: 8px;
}
.buttons a, .buttons button {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DFF4FF;
border-color: #EEEEEE #DEDEDE #DEDEDE #EEEEEE;
border-style: solid;
border-width: 1px;
color: #565656;
cursor: pointer;
font-family: Verdana,arial,sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 130%;
margin: 10px 10px 0 0;
padding: 4px 10px 3px 7px;
text-decoration: none;
}
.buttons button {
overflow: visible;
padding: 4px 10px 3px 7px;
width: auto;
}
The label needs to be
display:inline-block;
and the width is too large of either your label or input boxes. Padding and margins will cause problems with percentage widths because they are not taken into account.
Here is the updated css
div.boxx {
width: 500px;
}
div.boxx .input-text{
border:1px solid #A9C7F5;
color: #00557F;
font: 12px Arial;
width:60%;
margin:0 0 0.5em 0.25em;
}
div.boxx label{
display:block;
font: 13px Arial;
color:#00557F;
width:33%;
float:left;
text-align:left;
padding-right: 8px;
}
.buttons a, .buttons button {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DFF4FF;
border-color: #EEEEEE #DEDEDE #DEDEDE #EEEEEE;
border-style: solid;
border-width: 1px;
color: #565656;
cursor: pointer;
font-family: Verdana,arial,sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 130%;
margin: 10px 10px 0 0;
padding: 4px 10px 3px 7px;
text-decoration: none;
}
.buttons button {
overflow: visible;
padding: 4px 10px 3px 7px;
width: auto;
}
I know modern CSS people hate tables, but in this case (and with many alignment issues with divs) I recomment a nice little table.
<table>
<tr>
<td>Label1: </td><td><input type="text" /></td>
</tr><tr>
<td>Label2: </td><td><input type="text" /></td>
</tr><tr>
<td>Label3: </td><td><input type="text" /></td>
</tr>
</table>
<input type="button" />
Try something like this http://jsfiddle.net/mmyxD/
Is there a reason for all the margins/padding? Your width's are forcing the elements onto new lines.
You can also use divs and spans. Something like this:
<form action="">
<div class="row"><span class="label">label1:</span><span class="formw"><input type="text" size="25"></span></div>
<div class="row"><span class="label">label2:</span><span class="formw"><input type="text" size="25"></span></div>
<div class="spacer"> </div>
</form>
and css:
div.row {
clear: both;
padding-top: 10px;
}
div.row span.label {
float: left;
width: 33%;
text-align: left;
}
div.row span.formw input{
width: 100%;
}
div.row span.formw {
float: right;
width: 66%;
text-align: left;
}