CSS DiscussionCSS Discussion

CSS Discussion

You are not logged in.

RSS Feed

#1 2009 Dec 19th 11:52pm
Bronson
New Member
Posts: 1

All Divs Position Relative

OK here it is.

I'm working on a site that was developed by someone else at some other point in time.  I have run into a line of CSS code that makes me scratch my head.

div {
    position:relative;
}

Is this a wise thing to do on a global level?

Does this help any cross browser issues or is this a bad premise to a worse conclusion?

I want to know your opinions, so please feel free to speak as candidly as you like.

Cheers
Bronson

Offline

 

#2 2010 Jan 28th 10:25pm
jacobadoy
New Member
From: Denver
Posts: 1
Website

Re: All Divs Position Relative

Sometimes it is helpful and sometimes it isn't.  Honestly I try to avoid position in my code.  However with that said I do use position relative when it comes to my nav but outside of that I rarely use it.  I find when you have to use positions then you have more problems with them then they are worth it.

Offline

 

#3 2010 Jan 29th 10:58am
littleBird
CSS Expert
Posts: 237
Website

Re: All Divs Position Relative

By default all browsers interpret each block level page element to have position: static, which basically means it follows the the natural flow of the page. So by declaring position:relative on all DIV you are starting to force page behavior. This is not to say that it won't work its just that you may find yourself having to do more to achieve the same result.

I'm with jacobadoy, keep it simple, don't bother with position:relative unless you specifically need it.


littleBird, big mouth!

Offline

 

Board footer

Here are our fancy Validator and PunBB footer links.