Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

differences between IE and Mozila, CSS, absolute positions

Status
Not open for further replies.

ProgRedes

Programmer
Jun 18, 2005
4
CU
Hi...

I have a web site where I use CSS with absolute position. It works well using Mozilla but not using in IE.

You can visit my site at
I copied a piece of the CSS code below.

Code:
<div class='bodycenter'>...</div>

div.bodycenter {
	color:black;
	/*border: thin groove #000000;*/
	height: 400px;
	width: 580px;
	position: absolute;
}
 
If you declare an element is absolutely positioned, does it not make sense to actually state WHERE it's positioned too?

Use relative positioning wherever you can, it's much less problematic and you'll end up with a more robust site.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Use relative positioning wherever you can, it's much less problematic

In all fairness, you can't really say, on such a generic level, that absolute positioning is more problematic than relative.

Absolute positioning itself is not in the least bit problematic - it is the users who do not understand how it works that causes the confusion.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I think that's what I meant, I just didn't say it right :)

It's when it's used to solve positioning problems in the "I want that there so that's where it's going, don't argue" kind of way.

Actually, I'm not sure that's quite right either.

By using relative positioning and understanding how elements interact can help one understand how absolute positioning can be used effectively. I find that absolute positioning tends to be the "first stop" for CSS newcomers.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
it is the users who do not understand how it works that causes the confusion.
...and the browsers that don't implement it properly.

Looking at the site in question, I don't see any reason to use positioning at all, be it absolute or relative. Just simple margins and padding would do the job.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top