Banner Logo
Home
The Real Kato
About Me
Twitter
Facebook
Frozen Lunches
Links
Dooce
Sweat Pants Mom
Secret Agent Josephine
Vindauga
Contact



Archives
Most Recent

2020 February
2007 May
2007 April
2007 March
2007 February
2007 January
2006 December
2006 November
2006 October
2006 September
2006 August
2006 July
2006 June


Categories
All Categories 

bloggers 
books 
commentary 
dating 
food 
funnyhaha 
interesting 
life 
movies 
music 
politics 
reviews 
science 
site-business 
sports 
style 
techwatch 
television 
theater 
travel 


Recent Comments
On College Football 2019: Final
Ken said:
Hey Dan, thanks for being my only subscriber! Yeah I'll be rooting for Penn State (Memphis is a weir...
On College Football 2019: Final
Dan* said:
Thanks for the great articles this year Ken! I hope the Big 19 kicks ass in the bowl games. See you...
On College Football 2019: Week 9 Preview
DANIEL STAHLMAN* said:
Almost 2 weeks later, and I finally watched my recording of the game. It's probably good that I didn...
On College Football 2019: Week 8 Preview
Dan* said:
Great summaries of the games as usual, Ken. Penn State struggled in a lot of phases, but I was encou...
On College Football 2019: Week 3 Preview
Dan* said:
Hey Ken. Glad you are back for another year of college football! As always, I appreciate the insight...


<< Previous: In the News | Next: More Pseudo-Science >>

CSS Irritation
Friday, 2007 May 4 - 8:06 am
Who out there is a web designer? Maybe you can relate to this statement: whoever wrote the spec for CSS DIV positioning should be shot.

For those of you who aren't web designers, a DIV on a web page defines a box. In the cascading style sheet (CSS) for the web page, you can define where on the web page that box is supposed to appear. With me so far?

There are four ways you can define a box's position: static, absolute, relative, and fixed. The reason I say the spec writers should be shot is because "static" actually means "dynamic", "absolute" means "relative", "relative" means "offset", and "fixed" means "floating".

See?

Let me explain. "Static" means the box should appear in the flow along with other web content. So that's not static at all; it can change dynamically depending on the size and style of other content. "Absolute" means the box should appear at a position relative to the nearest positioned box (either a containing DIV, or the web page). "Relative" is like "static", but the box is moved by a defined offset from where it would normally appear. And "fixed" means when the web page moves, the box still appears at the same position on your screen (so it appears to float... this is how a lot of pop-up ads are done nowadays).

With regards to "absolute", there's another irritation. Normally when you define a position for a DIV, you put a "position:" attribute in the style definition for that DIV, and that's it. But when it comes to "absolute", that makes the box's position dependent on its own position attribute as well as the position attribute of the containing (parent) DIV. If none of the containing DIVs has a position (or if they're defined to be "static"), the box is positioned relative to the web page. If a containing DIV does have a position, the box is positioned relative to it.

Confused yet? See, this is why I'm so irritated. If I were writing the spec, I would define four position types: "inline", "parent", "page", and "window", and make them mean exactly what they say.

An excellent article on this topic is available on Austistic Cuckoo.
Permalink   Bookmark and Share
Posted by Ken in: site-businesstechwatch

Comments

There are no comments on this article.

Comments are closed for this post.
Login


Search This Site
Powered by FreeFind