Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Probably a Simple CSS Problem

    Hey there!

    Let's bite the bullet. Take a look at this:



    Isn't that odd? The "News" section shifted to the right and the nav bar disappeared.

    CSS Code:

    PHP Code:
    #nav {

    width900px;
    height25px;
    background-color#FEEDC5;
    vertical-aligntop;

    }

    #body {

    floatleft;
    width700px;
    height400px;
    background-color#FEDA8B;

    }

    #footer {

    width900px;
    height20px;
    background-color#9C6F0E;
    vertical-alignbottom;

    }

    /* Other */

    #news {

    floatright;
    width200px;
    height400px;
    background-color#FEEDC5;
    positionrelative;


    And the HTML snippet:

    PHP Code:
    <html>
    <
    head>
        <
    title>HabboShake Home</title>
        <
    link href="styles/style.css" rel="stylesheet" type="text/css">
    </
    head>
    <
    body>

    <
    div id="container">

    <
    div id="header">

    </
    div>

    <
    div id="nav">

    </
    div>

    <
    div id="body">

    </
    div>

    <
    div id="news">
    Hello peoplethis is a news article for the site.
    </
    div>

    <
    div id="footer">

    </
    div>

    </
    div>

    </
    body>
    </
    html
    Any ideas? Thanks!
    Last edited by imiles; 06-26-2010 at 03:29 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello imiles,
    Without spaces in your text there is no where to break. Try replacing Heyyyyyyyyyyyyyyyyyyyyy.ffffffffffffffff with an actual sentence that has spaces between the words.
    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

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks mate, using full sentences did fix part of the problem. But now, the nav bar disappeared and the news section shifted to the right.

    See updated image.

  • #4
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    Something like this?

    Code:
    <!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" />
    <style type="text/css">
    #nav {
    width: 900px;
    height: 25px;
    background-color: #FEEDC5;
    vertical-align: top;
    }
    #body {
    float: left;
    width: 700px;
    height: 400px;
    background-color: #FEDA8B;
    }
    #footer {
    float:left;
    width: 900px;
    height: 20px;
    background-color: #9C6F0E;
    vertical-align: bottom;
    }
    #news {
    float: left;
    width: 200px;
    height: 400px;
    background-color: #FEEDC5;
    position: relative;
    }  
    </style>
    </head>
    <body>
    
    <div id="container">
    
    <div id="header">
    
    </div>
    
    <div id="nav">
      Links</div>
    
    <div id="body">
    Body text
    </div>
    
    <div id="news">
    Hello people, this is a news article for the site.
    </div>
    
    <div id="footer">
    Footer text
    </div>
    
    </div>
    
    </body> 
    </html>
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #5
    New Coder
    Join Date
    Jun 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, worked like a charm.


  •  

    Posting Permissions

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