1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Floating: can you please explain something to me!!

Discussion in 'CSS' started by tayiper, Oct 11, 2007.

  1. #1
    Okay folks, as a some sort of an addition to the I need something very basic explained about CSS thread that I've opened here on DP forums recently (but never mind it, i.e. now I already understand what I was asking there about), I am asking about floating vs. non-floating in my (imeaning my website's) particular case ...


    You see, today I added the "div#content" to my website's index.html page's (well and of course, to all the other pages that have the same layout too) sheet1.css style-sheet file; basically I did it just to wrap the "div" around the main content area, which I thought would be logical thing to do. And surely after testing the code a bit (namely, trying out various values for "padding", "height", "width" properties), the layout is exactly as I intended it to be, and similar to what it was before, please also see below.
    SEMrush

    Here are the links to the old index-old.html page, and to the old sheet1-old.css style-sheet file.


    Now my question is the following: if now "div#menu" is floated to left, and "div#content" floated to right (so that the layout is like I wanted it), how come that even before doing these changes (i.e. with only the menu being wrapped into the "div", and of course, floated to left), the text/main content that I now also wrapped into the "div", was displayed beside the menu anyways (i.e. on its right side), i.e. even without explicitly floating it to the right??!


    P.S. - Although it's true that in fact I do *somehow* suspect what might be the reason for this, I'm asking it here anyway just to be completely sure!!


    tayiper
     
    tayiper, Oct 11, 2007 IP
    SEMrush
  2. mcfox

    mcfox Wind Maker

    Messages:
    7,527
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #2
    It simply slotted into the first available space on the page, which happened to be next to the menu.
     
    mcfox, Oct 11, 2007 IP
    tayiper likes this.
  3. tayiper

    tayiper Active Member

    Messages:
    421
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #3
    Ahhhh thanks much mcfox, so it is pretty much as I've speculated/suspected ...


    tayiper
     
    tayiper, Oct 11, 2007 IP