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

2018 June
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 New CBS Show Scorpion Riddled with Errors
e.* said:
also, 7a: disk-based backup targets don't work that way. you don't back up anything to one single so...
On New CBS Show Scorpion Riddled with Errors
Stephen J* said:
Wasn't planning on watching, now definitely won't.

19a: if the whole Ethernet cord to sportscar th...
On College Football 2013: Week 10 Preview
Ken said:
Update: Bryan Underwood is out with an injury. Umm, that's not good.
On It's Just (a) Lunch (Scam)?
kiki* said:
Run! Do not join this service! It is a waste of money. I was scheduled for several different dates. ...
On It's Just (a) Lunch (Scam)?
Informed* said:
Guys and women,

Amost everybody seems to be scammed by this company. Why then are they in business ...


<< 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