• i’m new to div tags, and i’m trying to figure out why everyone thinks they’re so great. anyway, i keep running into problems like this:
    https://macographie.com/divlayout.htm
    this page looks fine in ie, but firefox doesn’t display the body div. could someone help me figure out what i’m doingn wrong?

Viewing 10 replies - 1 through 10 (of 10 total)
  • fix the errors:

    https://validator.w3.org/check?uri=http%3A%2F%2Fmacographie.com%2Fdivlayout.htm&charset=%28detect+automatically%29&doctype=XHTML+1.0+Strict&ss=1&outline=1&verbose=1

    Addtionally you’ve set a list of values for the body in your css then added another set to your page. Once your code is correct it will display as it should in FF. Right now FF is reading it as it is written, which is incorrect. If written to the standards that are accepted by the W3C it will display correctly. IE ignores those standards and says if it’s badly coded, it’s still good. Your page failed to validate even as HTML 4.01

    Thread Starter macographer

    (@macographer)

    ok, could you explain why the meta tag is giving an error?

    Thread Starter macographer

    (@macographer)

    ignore my last request. i’ve got the page validating to HTML 1.0 Strict guidelines. but it still isn’t displaying the way i’m wanting it to in firefox.

    hopefully someone else can do a better job of it:

    body {
    font-family: Arial;
    font-size: 12px;
    background-color: #000000;
    margin: auto;
    }

    #sidebar {
    width: 150px;
    border: solid 1px black;
    float: right;
    margin-top: 10px;
    margin-bottom: 10px;
    clear: both;
    }
    #menubg {

    left: 0px;
    right: 0px;
    top: 1px;
    width: 100%;
    height: 20px;
    background-color: #9C9;
    }
    #bodybg {
    width: 100%;
    margin-top: 2px;
    margin-right: 0px;
    margin-left: 0px;
    background-color: #FFF;
    }
    #foot {
    text-align: center;
    height: 20px;
    position: relative;
    margin-top: 3px;
    background-color: #9C9;
    }

    #titlebg {
    width: 100%;
    height: 50px;
    background-color: #333;
    }

    Make it work in FF, then make it work with IE. Or you can ignore FF and just make it work in IE, in which case there’s nothing to change:)

    Put your CSS in a style.css file and call it in the header part of the document. You need add a correct doctype too.

    You cant have an id of body AFAIK. At least not twice.

    Thread Starter macographer

    (@macographer)

    thanks. i’m one step closer. now i just gotta figure out why the content and sidebar divs aren’t being placed where i expect.

    **edit
    i thought it was working, but i forgot to change the id in the div tag. when i changed it to match my css, it stopped showing up again. the problem is with the ‘bodybg’ id. i guess the fact that it has ‘body’ in it doesn’t make a difference, because i just checked it. this kind of problem is what stops me from using div tags more heavily. i know it’s my problem, but i can’t seem to figure out what i’m doing wrong.

    Well it isnt running smoothly for two reasons. A floated elerment needs to be first in the source order. And some browsers will not display a div with no content at all.

    Thread Starter macographer

    (@macographer)

    do i need to switch over to absolute positioning? if i understand things correctly, the source order is important when using relative positioning. but if i change it, the sections won’t show up in the right places.

    This is not really a WP question. A CSS resource might give you better feedback. But for blogging you need to stick with float.

    Thread Starter macographer

    (@macographer)

    what do you men by needing to stick with float? do you mean i should keep the float properties set the way they are and change other things to get it to look right?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘div tags and firefox’ is closed to new replies.