Home Technical Talk

Div layers in web design

polycounter lvl 18
Offline / Send Message
John Warner polycounter lvl 18
update: well, i got my site working, although i still don't reaaaaaaaaaaaaaaallyy understand why some stuff works the way it does. my test were inconclusive and crazy. crazy.

origional post:

ARRGHH!! what the fuck! i've been trying to design this web page using div layers, and they're acting totaly crazy, moving all over on me, to the point where i'm starting to wonder if it's not user error, but a design flaw, where as they're unpredictable pieces of shit.

to illustrate:

i have a div layer that all of a sudden moved a good half page down from where it should be. as a test, i deleted the part that said:

"POSITION: absolute; top: 727px; left: 45px; right: -10px; height: 100px; width: 100%;"

and it stayed in the same place. i went back and added again the above line, and it jumped down another bunch (i'm guessing 727 pixels.

absolutely insane!

also, could someone explain to me why adding a

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd&quot; >

on the very top of my page TOTALY and completely changes the way my div layers behaive? it fixed ONE problem i was having, and caused like 3 more. when i removed itagain, of course, the 3 more problems it caused stayed there. ffffaaaawwkkin hewl.

ideas? anyone? i'm starting to lose it.

Replies

  • John Warner
    Options
    Offline / Send Message
    John Warner polycounter lvl 18
    A HAH! why is it that when ever i make a post, i always figgure it out RIGHT afterwards.

    div layers define their 'starting points' based on what order they are in in the code. so if i have a div layer that's 25 pixels down, the next div layer will start 25 pixels down, unless i say that it should start -25 pixels down, at which case it'll start at the top of the page..

    i could have sworn that this only turned on when i put in that crazy line of text about the W3c however. anyone have any thoughts on that?

    edit: ah! scratch that last bit! i've got a div layer under another div layer set to top:0; and it's at the very top of the webpage!

    the 2 div layers have a table between the 2, however, that's not in a div layer. hmm.. so how does having stuff outside a div layer effect div layers?

    jehhsus time to start up a test page. when i figgure this stuff out i'm going to write a book. it'll sell like hotcakes.
  • hawken
  • John Warner
    Options
    Offline / Send Message
    John Warner polycounter lvl 18
    well shit, hawken, i totaly missed that thred. as it happens, my web page is working, so i don't need the help, but i'd be more than happy to take a look at things.

    i can set up crazy character rigs in xsi, and know how to do it more or less in max, but without things like rotation limits, etc etc etc.

    i would, however, be happy enough to take a look at an example mesh and build a skeleton to match the model, if it helps.

    you can email an example mesh to 3d45john@vfs.com

    why not just use character studio? and not to sound condecending, but setting up a simple rig isn't an OVERLY difficult process-- is there something specific you're after and can't achive?

    anyway i'd be happy to take a look at things
  • jzero
    Options
    Offline / Send Message
    jzero polycounter lvl 18
    John: Two things that you may or may not have sussed about your web design problems. It all has to do with how HTML amd CSS get rendered by the browser.

    One, putting that line of code at the beginning of your page lets the browser know exactly what flavor of HTML you were intending to use. So much for standards, right?

    Two, there's no guarantees about how 'exotic and sophisticated' stuff like <DIV> with CSS is going to get rendered, because to my (admittedly generalized) knowledge, nobody has ever built a browser that actually renders ALL of the possible CSS attributes correctly. I really hope I am wrong about this.

    But my overall impression of the way HTML and its associated stuff has been implemented is, it's teh suck. HTML was never intended to be a page design language, I think it has more in common with RTF. And since CSS came along, I don't think anyone's made good enough use of it. When I validate my pages in Dreamweaver, it tells me which parts of CSS are poorly implemented by everyone in the world. Suckage supreme.

    Since web page design isn't really my ultimate strength, I just look around for someone's page that does work, and copy what they did. I never rely on the principles of the specs. That way lies madness.

    /jzero
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    [ QUOTE ]
    And since CSS came along, I don't think anyone's made good enough use of it.

    [/ QUOTE ]

    www.csszengarden.com
  • hawken
    Options
    Offline / Send Message
    hawken polycounter lvl 19
    [ QUOTE ]
    John: Two things that you may or may not have sussed about your web design problems. It all has to do with how HTML amd CSS get rendered by the browser.

    One, putting that line of code at the beginning of your page lets the browser know exactly what flavor of HTML you were intending to use. So much for standards, right?

    Two, there's no guarantees about how 'exotic and sophisticated' stuff like <DIV> with CSS is going to get rendered, because to my (admittedly generalized) knowledge, nobody has ever built a browser that actually renders ALL of the possible CSS attributes correctly. I really hope I am wrong about this.

    But my overall impression of the way HTML and its associated stuff has been implemented is, it's teh suck. HTML was never intended to be a page design language, I think it has more in common with RTF. And since CSS came along, I don't think anyone's made good enough use of it. When I validate my pages in Dreamweaver, it tells me which parts of CSS are poorly implemented by everyone in the world. Suckage supreme.

    Since web page design isn't really my ultimate strength, I just look around for someone's page that does work, and copy what they did. I never rely on the principles of the specs. That way lies madness.

    /jzero

    [/ QUOTE ]

    I think you're confusing standard code (xhtml & css) set out by the W3C and css invented by microsoft. One follows standards and is interpretated properly by browsers like firefox, the other only works on the latest version of IE on the PC in windows XP.

    Using CSS to control DIV's is perfectly normal.

    Take a look at my homepage for an example of standards compliant HTML with CSS intergration: http://hawken.dadako.com

    BTW: HTML was invented to create page design for simple documents shared by universities and the military. Although you could think of it as being an advanced word doc language.

    All of this is changing with xhtml. It's a shame that the basic code of the internet is changing so slowly, but that is the nature of the beast. Rapid development always has it's flaws.

    (I've heard that Vista is dropping support for standard HTML)
  • Isis' Minion
    Options
    Offline / Send Message
    Isis' Minion polycounter lvl 18
    [ QUOTE ]
    ...http://hawken.dadako.com...

    [/ QUOTE ]

    With all due respect, but...MY EYES shocked.gif

    DIVs can come in pretty handy, but i still like using Table best smile.gif
    And btw, i saw some guys at school using Flash and XML to make a dynamicly loading portfolio site. That was pretty sweet as well, i'm probably going to make one as well...
  • hawken
    Options
    Offline / Send Message
    hawken polycounter lvl 19
    tables shouldn't be used for layout. The sooner you understand this, the sooner your markup will be cleaner.
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    I use nothing but span and div. Everything else is regulated in the CSS.
  • John Warner
    Options
    Offline / Send Message
    John Warner polycounter lvl 18
    OOooohhh thanks alot for the replies, guys. much apprecieated.
  • JonMurphy
    Options
    Offline / Send Message
    JonMurphy polycounter lvl 18
    CSS is a godsend. I recently re-did my cottage. All I did was change layout graphics and the CSS. Voila, site redesign in an evening.

    Positioning DIVs can be a nightmare, though, each browser seems to add a little here, take off a little there.
  • Isis' Minion
    Options
    Offline / Send Message
    Isis' Minion polycounter lvl 18
    [ QUOTE ]
    CSS is a godsend. I recently re-did my cottage. All I did was change layout graphics and the CSS. Voila, site redesign in an evening.

    Positioning DIVs can be a nightmare, though, each browser seems to add a little here, take off a little there.

    [/ QUOTE ]

    Yeah...i also had the problem of positioning the DIVs.
    http://www2.hku.nl/~mark2
    Firefox displays it the right way, Internet Explorer kills it. confused.gif (nevermind the content, i just put some random stuff in there, since it was a school assignment)

    I made a start with a dynamically loading Flash portfolio site using XML. It's pretty easy grin.gif
  • jzero
    Options
    Offline / Send Message
    jzero polycounter lvl 18
    Rick and everybody, I misspoke. What I said was, "And since CSS came along, I don't think anyone's made good enough use of it.", but what I meant to say was, no one has completey implemented it in a browser yet.

    Or am I wrong, does Firefox? ooo.gif

    /jzero
Sign In or Register to comment.