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 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Divs aren't working for me... What did I do wrong? I'm new at this.

    HTML:
    <!DOCTYPE html>
    <html lang="en">
    <link rel="stylesheet" type="text/css" href="floatandclear.css" />

    <head>
    <meta charset="utf-8">
    <meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
    <meta name="created" content="Sun, 13 Feb 2011 01:40:07 GMT">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>Three Column Liquid Layout</title>

    <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <body>
    <div id=”header”>Header</div>
    <div id=”leftcolumn”>Left column</div>
    <div id=”rightcolumn”>Right column</div>
    <div id=”bodytext”>Main page text goes here.</div>
    <div id=”footer”>Footer</div>

    </body>
    </html>



    ------CSS------
    /* Default CSS */

    body {
    margin: 0px;
    padding: 0px;
    }

    #header {
    width: 100%;
    background-color: #CCCCCC;
    }

    #footer {
    width: 100%;
    clear: both;
    background-color: #CCCCCC;
    }

    #leftcolumn {
    float: left;
    width: 20%;
    height: 600px;
    background-color: #999999;
    }

    #rightcolumn {
    float: right;
    width: 20%;
    height: 600px;
    background-color: #999999;
    }

    #bodytext {
    float: left;
    background: #fff;
    width: 60%;
    height: 600px;
    }

  • #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 jamman0411,
    You have the link to your CSS in the wrong place, other than that it seems fine.
    What is the problem?
    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

  • Users who have thanked Excavator for this post:

    jamman0411 (02-13-2011)

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    When I preview the html it just shows all the words inside the divs in a list... And the float and clear that I have in the css didn't move them. And I put background-color: black; in the body of the css and when i preview the html it's all black so that means they are linked right? Where is the link supposed to go? Thanks.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by jamman0411 View Post
    When I preview the html it just shows all the words inside the divs in a list... And the float and clear that I have in the css didn't move them. And I put background-color: black; in the body of the css and when i preview the html it's all black so that means they are linked right? Where is the link supposed to go? Thanks.
    The link to your CSS belongs inside the head tags of your document. The code you quote in your first post has that link before the head starts.

    Do you have some updated code so we can see your current issues?
    Have you tried validating that code yet? That may clear up many of your problems.
    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

  • Users who have thanked Excavator for this post:

    jamman0411 (02-13-2011)

  • #5
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Ok thanks. I validated the css and html and they both passed... And in the preview it just shows the words in a list with no css at all... So I have no idea what I did wrong... But it's not working for me.. The code is the same as before besides I put the link inside the <head> tag. I'm just trying to get the divs to take effect before I move on..
    Last edited by jamman0411; 02-13-2011 at 06:06 PM.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by jamman0411 View Post
    And in the preview it just shows the words in a list with no css at all...
    What are you using to preview this with? Have you tested this in a real browser (FireFox)?
    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

  • Users who have thanked Excavator for this post:

    jamman0411 (02-13-2011)

  • #7
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I'm using coffeecup html editor and also i can right-click and press preview in browser... I tested it in internet explorer and it's still in a list.. I also tried it in mozila firefox.
    Last edited by jamman0411; 02-13-2011 at 06:15 PM.

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by jamman0411 View Post
    I'm using coffeecup html editor and also i can right-click and press preview in browser... I tested it in internet explorer and it's still in a list..
    I guess I don't know what you mean by "in a list." Your code doesn't have any list, the only text is just the 2 or 3 words that describe each element.

    Is there any chance you can put up a test site so we can see what you're seeing? A screencap could be posted here to show it too, but a test site would be better.
    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

  • #9
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    All i see is this:

    Header
    Left column
    Right column
    Main page text goes here.
    Footer

    those words in the top-left corner of the screen... I'll set up a test site.

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,620
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Is the path to the stylesheet correct?

  • #11
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    floatandclear.clanteam.com

    I renamed the html file to index.html

    Everything else is the same...

  • #12
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,620
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Ah, I see! Hah, that one is hard to spot, I admit.

    You’ve used so called “smart quotes” for the attribute values which kinda doesn’t work obviously. So rather than:
    Code:
    <div id=header>
    it must be
    Code:
    <div id="header">
    Small difference, big impact.

  • Users who have thanked VIPStephan for this post:

    jamman0411 (02-13-2011)

  • #13
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Wow... Thank you so much you just saved my day! I'm just starting to learn about web design and I was gettin really frustrated lol ahh thank you! : )


  •  

    Posting Permissions

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