Jump to content

Recommended Posts

I see a lot of pages where the login and register forms are set up where the text is right aligned next to the forms and it is all centered. I think this is done with CSS somehow, but dont know how. Can I get some help on how to create one of these aesthetic form setups?
Link to comment
https://forums.phpfreaks.com/topic/32623-simple-formtext-alignment/
Share on other sites

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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.