Jump to content

Simple Form/Text Alignment


AXiSS

Recommended Posts

http://jeffhowden.com/code/css/forms/
I found this very helpful awhile back, when I started using tables for forms themselves.  I got tired of doing it, so I did some research and found that, it solved all my problems, even for small login forms, and allowed me to branch off to even better more customized styles.  Read that slowly, and understand it all, then you shouldn't have problem with form styling even more, it even covers cross browser issues.
[quote author=businessman332211 link=topic=120751.msg501511#msg501511 date=1168454720]
http://jeffhowden.com/code/css/forms/
I found this very helpful awhile back, when I started using tables for forms themselves.  I got tired of doing it, so I did some research and found that, it solved all my problems, even for small login forms, and allowed me to branch off to even better more customized styles.  Read that slowly, and understand it all, then you shouldn't have problem with form styling even more, it even covers cross browser issues.
[/quote]

I didn't have much luck decoding that.
Try this out. You will need to add a few more things, but I think you'll get the idea...

[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS Forms</title>
<style type="text/css">
<!--

body{
background-color:#000000;
}

#form_wrapper{
width:500px;
}

.left_form{
width:50%;
float:left;
text-align:right;
}

.right_form{
width:50%;
float:left;
text-align:left;
}

.left_hdr{
color:#FFFFFF;
font-weight:bold;
font-size:12px;
}

.left_text{
color:#999999;
font-size:9px;
}

.clear{
clear:both;
}

-->
</style></head>

<body>
<form action="process.php" method="post">
<div id="form_wrapper">

<div class="left_form">
<div class="left_hdr">Your Name</div><!-- End left_hdr-->
<div class="left_text">Please enter your name</div><!-- End left_text-->
</div><!-- End left_form-->
<div class="right_form">
<input name="name" type="text" />
</div><!-- End right_form-->

<div class="clear"></div><!-- End clear-->


</div><!-- End form_wrapper-->
</form>
</body>
</html>
[/code]

-Chris

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.