homepage Welcome to WebmasterWorld Guest from 23.23.12.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Absolute positioning bad?
absolute positioning checkbox
RobSil

5+ Year Member



 
Msg#: 3821198 posted 5:22 pm on Jan 7, 2009 (gmt 0)

Hey all,

I have a 300 x 200 div floated in my page, nested a few div's thick. The div is for username/password to log-into my site. It is typical layout....

user: [__________________]
pass: [__________________]
[] remember me login

Based on research I've seen various opinion's on ways to do this, including:
- <p> tags per row
- <div> tags per row
- absolute positioning

So far I have not seen arguments to support any opinions, just (usually strong, sometimes negative) opinions. I want to ask... is absolute positioning bad? If so, why?

I should mention, I still haven't quite gotten an epiphany with CSS/html as to how you structure your page (getting there, but not quite yet) so bear with me if this is too remedial.

Thx,
Rob

 

4css

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3821198 posted 6:56 pm on Jan 7, 2009 (gmt 0)

I think that most who would reply would have their own opinions regarding your question. In regards to absolute positioning.

It is just a matter of how they style their sites.

I prefer to use a fixed width with floats within. Just my preference.

If you are just starting out with css, You could do many searches within WebmasterWorld to get information. I'm sure if you searched absolute positioning, you will find a few discussions in regards to it. Also check out WebmasterWorld's library, it is filled with information.

And, of course, don't' forget to Google things that you might have questions about.

swa66

WebmasterWorld Senior Member swa66 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3821198 posted 7:39 pm on Jan 7, 2009 (gmt 0)

These things are as always just an opinion:

I like to use other tags than <div>, I consider an overuse of <div> just as bad as using <table> for layout.
I prefer the html to make sense without the CSS.

Absolute positioning, relative positioning, just go with the flow, use margins and padding, or floats: they all have their place and all can be used to achieve something, which you choose is bottom line your choice. It's hard to label one better than the other. Use the right tool for the task at hand.

Wlauzon

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3821198 posted 8:59 am on Jan 8, 2009 (gmt 0)

Absolute positioning can be one of the hardest things to get working right in all browsers, so I tend to avoid it unless really needed.

Perhaps when (if) IE6 ever goes away it will be more useful, but for now it can cause issues.

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3821198 posted 3:31 pm on Jan 8, 2009 (gmt 0)

I have a 300 x 200 div floated in my page.....

I think the largest opposition to absolute positioning is inherent in your question - it nearly always goes hand in hand with pixel sizing of elements and text (although you can position absolutely without pixel sizing . . . )

When you specify an element by pixel size, you're likely to also specify the text by pixel size, which can produce unexpected results with varying monitor resolutions - an 11px type size will reduce to infinity on a high rez monitor.

Second, it's most likely related to accessibility. A good rule of thumb is to design/develop so that the layout will either adapt or degrade gracefully for any user environment or browser. Someone should be able to increase/decrease text size, use their own style sheets or at least set background colors without your layout falling apart. Absolute positioning and pixel-perfect assignments tend to fall apart when you apply these environment changes.

Wlauzon

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3821198 posted 11:01 pm on Jan 8, 2009 (gmt 0)

I have gone to using pretty much only em's and %, but that has it's issues too in some instances, especially when you get into "cascading ems" with nested divs.

It would be simple if all browsers and all monitors worked the same :(

simonuk

10+ Year Member



 
Msg#: 3821198 posted 3:22 pm on Jan 9, 2009 (gmt 0)

Personally in your case I would use none of your options and instead style the form using its own attributes (form, fieldset, input etc).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved