joujoba
02-11-2010, 05:10 AM
hello
how can i make my background page color red, and inside of it a form with a background color yellow?
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<p class="response"><?=$output?></p>
<p>
<label for="">Name:</label>
<input id="" type="text" name="" />
</p>
<p>
<input type="submit" class="button" name="create" value="" />
</p>
</form>
thanks
Driver01
02-11-2010, 06:41 AM
CSS:
body{background: red;}
.form1{background: yellow;}
Then add the class .form to the form:
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" class="form1">
That makes the complete body backgound red but if you wanted to add the color to just the container of the page just do the same as you have with the form, create a id or class and add to the element:
CSS:
#container{background: red;}
.form1{background: yellow;}
HTML:
<div id="container">
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" class="form1">
<p class="response"><?=$output?></p>
<p>
<label for="">Name:</label>
<input id="" type="text" name="" />
</p>
<p>
<input type="submit" class="button" name="create" value="" />
</p>
</form>
</div>
remember that a class is identified by a . whereas an ID is a # classes can be reused throughout the same page/document but ID's are unique to an element and may only be used once in the same page/documnet.
Hope this helps
BroadlineTim
02-11-2010, 06:42 AM
hello
how can i make my background page color red, and inside of it a form with a background color yellow?
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" style="background-color: yellow;">
<p class="response"><?=$output?></p>
<p>
<label for="">Name:</label>
<input id="" type="text" name="" />
</p>
<p>
<input type="submit" class="button" name="create" value="" />
</p>
</form>
thanks
Added it to your code.
Driver01
02-11-2010, 06:55 AM
Added it to your code.
Yep sure that works too, just a force of habit that I don't add inline css. The only thing is he/she requires the container to have a red background too. ;)
joujoba
02-11-2010, 11:34 PM
thanks it worked^^
one more thing please, how can i add a banner in the same line of the form but outside to the right?
because using div didn't work
Bingen
02-13-2010, 07:54 PM
.form1 {background: url(theimage.jpg) no-repeat top left yellow;}
Maybe...
Driver01
02-15-2010, 04:25 AM
Use div's as containers for your content and positon them with css using either position, or float. Whichever works better in your layout. Divs are by default 100% wide and float left.