Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Thanked 0 Times in 0 Posts

    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.


    .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;}
    #content{padding-top: 1em; float:left;width:25%;}
    #content2{padding-top: 1em; float:left;width:25%;}
    .dt {height:22px;}
    .dt2 {height:19px;}
    <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>

  2. #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,874 Times in 1,858 Posts
    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 -
    .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 a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts