CSS relative positioning help needed!

Discussion in 'CSS' started by waco1870, Jul 31, 2006.

  1. #1
    I usually use absolute positioning in my websites, but am trying to learn to use relative positioning so I can have a centered layout instead of left-butted.

    I've crafted my first site, but have a bunch of extra space underneath the main website, which, as I understand it, is because space is created for the normal flow of the elements I've positioned relatively. So how do I get rid of it? I have colored them purple and white so you can easily see them. The site is at:

    http://www.wacocvb.com/eng2/

    Thank you very, very much for any help you can give me on this!:)
     
    waco1870, Jul 31, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    For starters, don't use relative or absolute positioning for laying out the main groups. Both have gotchas that will bite you if you do not fully understand how they work.

    Second, do not use the style attribute within the various elements. Place all style rules in your stylesheet. During development, embed the stylesheet in the head of the document.

    To debug this page, upload a screencap of the page or an image of the desired layout for reference (and post the link). Then move all inlined styles to the stylesheet in the head. Remove all {position: relative;} property/value sets and all top and left/right properties and their values.

    That should get everything back to neutral. The next step will be to ensure the markup is valid (it's not now), and semantic (it's not that either). Once done, it will be pretty straight forward to deal with getting things where you want them to be.

    cheers,

    gary
     
    kk5st, Jul 31, 2006 IP