Hey, Ive done graphic and print design for a while. I have designed websites but never understood how to code them correctly. Well I am trying to teach myself and have watched a few tutorials and read through some stuff but I guess the positioning part throws me off. How to place what I want exactly where it should be in all browsers. Heres a sample of what I'm trying to do: coded so far (and way off): http://www.eight84.com/theidea/ The image from photoshop: http://www.eight84.com/theidea/theidea.jpg Thanks for anyone willing to help me out.
I worked on your code and made some changes. You should figure out easily what I have done, if you compare yours now with this one. Hope I could help. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>eight84</title> <style type="text/css"> <!-- body { background-color: #f9fbf4; margin-top: 0px; } body,td,th { font-family: Arial; font-size: 12px; color: #64937d; } a:link { color: #222222; text-decoration: none; } a:visited { color: #222222; text-decoration: none; } a:active { color: #222222; text-decoration: none; } a:hover { color: #88970a; text-decoration: none; } #title { background-image: url(http://www.eight84.com/theidea/images/title_1.jpg); background-repeat: no-repeat; float:left; height: 135px; width: 173px; margin-top: 0px; padding-top: 0px; } #wrap { text-align: left; width: 940px; margin: 0; padding: 0 90px; } #nav { float: left; margin-left:440px; width: 270px; height: 135px; } #nav ul{ margin-top:100px; list-style:none; width:270px; } #nav ul li{ float:left; text-align:right; width:90px; } #text { margin-top: 250px; width: 475px; height: 631px; float: left; } #feature { background-image: url(http://www.eight84.com/theidea/images/image_1.jpg); background-repeat: no-repeat; margin-top: 250px; width: 449px; height: 631px; float: left; } .clear { clear:both; } --> </style></head> <body> <div id="wrap"> <div id="title"> </div> <div id="nav"> <ul> <li>Home</li> <li>Porfolio</li> <li>Contact</li> </ul> </div> <div class="clear"></div> <div id="text"><img src="http://www.eight84.com/theidea/images/text_1.jpg" width="475" height="466" /> </div> <div id="feature"> </div> </div> </body> </html> Code (markup):
Use margin:auto; in explorer had to the top of your html file <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Good Luck
Ah sorry I took out the auto in the margin. Just put margin:0 auto; back into the #wrap part. I thought it was a mistake cause in the image it looked left aligned. And if you want it horizontal centered you might wanna take out the padding:0 90px; in #wrap. otherwise you have 90px more distance to the left. and less to the right and it wouldn't be centered.
Thanks! I am starting to see how to do this! I always need to see how things look coded and I'm finally learning how to do it!
it breaks the float pattern. If an element like a div for example is set to clear:both, it don't allows floating elements on each site of this div/element.