Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-20-2010, 11:53 PM   PM User | #1
Jedziemy
New to the CF scene

 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Jedziemy is an unknown quantity at this point
HTML/CSS/DIV Columns



That's what it should look like (it does in Dreamweaver). It fails to do so when displayed in browser. Any help appreciated.

CODE:

<style>
.new {background-color:#41383C;color:#98AFC7;}
.czas {font-family:verdana;color:#eeeeee;background-color:#595454; border:1px solid black;padding:2px}
.link {color:#808080;}
.link:hover {color:#a0a0a0}
body{margin: 0;padding: 0;}
#banner {margin: 0;padding: .5em;}
#nav{float: left;width: 45%;}
#nav p{margin-top: 0;}
#subheader{float:right;width:50%;}
#subheader2{float:right;width:100%;}
#content{padding-top: 1em; float:left;width:25%;}
#content2{padding-top: 1em; float:left;width:25%;}
.dt {height:22px;}
.dt2 {height:19px;}
</style>
<title>XXX</title>
<body bgcolor="595454">
<div class="new" style="margin: 1em 5%;">
<div align="center" id="banner"><strong style="font-size:26px">X</strong></div>
<div id="nav" style="height:345px" align="center"><strong style="font-size:26px;">X</strong></div>
<div id="content" style="height:265px; padding-left:15px">
<a href="mailingList2.php?addEmail=decor" class="link">XXXX</a></div>
<div id="content2" style="height:265px;">XXXX</div>
<div id="subheader" style="height:80px;padding-left:0%;" align="left"><!--[if IE]>
<span style="width:450"><![endif]--> XXXX </div>
<div align="center" class="new" style="font-weight:bold; width:100%">XXXX</div>
</div>
</body>
</html>
Jedziemy is offline   Reply With Quote
Old 11-21-2010, 12:43 AM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello Jedziemy,
Dreamweaver is famous for not rendering code like any known browser. Hopefully you did not buy DW for it's Design window. Instead, just test your code in a real browser, like FireFox.

Your not seeing .new expand to contain it's elements because they are floated and you have not cleared your floats.
Try making your CSS look like this -
Code:
.new {
	background: #41383C;
	color: #98AFC7;
	overflow: auto;
}
Here's a page that describes how overflow: auto; clears floats.


Of course, even after you clear the floats it doesn't look like DW's design window is showing it. Those yellow dotted lines are a DW thing and not a part of your code.

Also, your inline styles will not help you later. It's much better to style things from the CSS.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:50 AM.


Advertisement
Log in to turn off these ads.