2 replies [Last post]
mendy
mendy's picture
Offline
newbie
Last seen: 9 years 31 weeks ago
Timezone: GMT-5
Joined: 2013-01-10
Posts: 1
Points: 2

Hello,

I'm new to CSS.

I was trying to make a simple form, however I don't know how to align 2 boxes.

Can someone please tell me how I could do it?

Code:

<form action="" method="get">
<ul>
<li>
    <label for="name"> Enter your First and Last name</label>
	<input id="name" name="name" />
</li>
<li>
	<label for="age" id="age"> Enter your age</label>
	<input id="age" name="age" />
</li>
<li>
 
	<label for="comments"> Enter your comments</label>
	<textarea id="comments" name="comments"> </textarea>
</li>
 
<li>
	<label for="Favorite language"> What is your favorite language</label>
	<input type="checkbox" id="Python" name="Python" />Python</input>
	<input type="checkbox" id="Javascript" name="Javascript" />Javascript</input>
	<input type="checkbox" id="CSS" name="css"> CSS</input>
</li>
 
	<input type="submit" />
 
 
</ul
 
 
 
 
 
</form>
 
form li 
{
	font-family: sans-serif;
	padding-bottom: 15px;
	font-weight: bold;
 
}
form ul
{
	list-style: none;
	padding-left: 0;
	text-align: left;
}
textarea
{
	width: 300px;
	height: 150px;
}
form		
{
width:250px;
}
label
{
	display: block
}
#comments
{
padding-left: 1px;
}
#age
{
	padding-right: 15px;
	position: relative;
	left: 250px;
	bottom: 58;
}

Thanks

Calman45
Calman45's picture
Offline
Regular
Okanagan Valley, BC
Last seen: 8 years 38 weeks ago
Okanagan Valley, BC
Timezone: GMT-8
Joined: 2013-01-04
Posts: 31
Points: 38

Hi mendy, Can you be more

Hi mendy,

Can you be more specific on what you are trying to align? ... I would assume your form input boxes, but don't know if you are trying to vertically align beneath each other, or what layout you are trying to achieve.

I am also new to CSS, but I would hazard a guess that you need well controlled DIV's with text-align or float tags to place them exactly where you need them to be.

Hope this helps?

All the best,
Cal Smile

MarkDavid
MarkDavid's picture
Offline
newbie
USA
Last seen: 9 years 25 weeks ago
USA
Timezone: GMT+7
Joined: 2012-11-20
Posts: 5
Points: 8

You can align that fields by

You can align that fields by using "div" tag or Table.

[wait 'til you've earned a sig line ~gt]