Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Float vs. Absolute (Which Would You Use?)
Old 12-21-2007, 07:30 AM Float vs. Absolute (Which Would You Use?)
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Greetings everyone.

I'm new to this forum as well.

I want to start off with a general question that's been bugging me.
I'm developing my first site by writing out the code first (I'll use DreamWeaver once I have a working knowledge of HTML/CSS).

I'm redesigning my site because I've been told I used absolute positioning to much (also I have other issues with the site as well).

It was suggested to me that absolute positioning isn't necessary and that everything can go within the normal flow of the document and positioned by using float (margin/padding).

Now, I want to be as precise as possible when coding. I don't want to use excessive coding where it isn't needed. But I'm thinking that depending on the type of site you are developing (or the complexity) - one w/ high graphic images i.e. model sites, fashion sites vs. one that's highly text based i.e. yahoo.com, msn.com - you would choose the type of positioning necessary.

Like entertainment sites that are image driven aren't that complex and pages really don't have much clutter - or if this is your intent, then absolute positioning will suffice because it makes things easier. Whereas sites with a lot of text, columns, and images may need float positioning because if you update the site w/ replacement images, text or w/ addtl...you don't want to break up the flow. You want everything to be locked in as much as possible.

What are your thoughts please....
LayneMitch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-21-2007, 07:49 AM Re: Float vs. Absolute (Which Would You Use?)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
It was suggested to me that absolute positioning isn't necessary and that everything can go within the normal flow of the document and positioned by using float (margin/padding).
Absolutely YES!!

Quote:
I don't want to use excessive coding where it isn't needed. But I'm thinking that depending on the type of site you are developing (or the complexity) - one w/ high graphic images i.e. model sites, fashion sites vs. one that's highly text based i.e. yahoo.com, msn.com - you would choose the type of positioning necessary
Not really, the vast majority of layouts could be done with little to no positioning needed. Just floats and margins where adjustments are required.

Too many people go overboard with position:relative on just about every element, which of course brings other likely problems into play.

Design the layout with NO positioning at all, just floats & margins, then move the elements relatively should they need it.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-21-2007, 08:25 AM Re: Float vs. Absolute (Which Would You Use?)
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Okay.

I'm also being told that one bad thing about absolute positioning is that once the font size is reset or enlarged, that immediately leads to a break in my document flow.

But what about a site designed like this... www.kooklub.co.uk

You can't increase the font size because it's a highly graphic designed
site. Images are saved separately and increasing the font size would ruin the
look. This is what I mean by entertainment sites or high graphic design
dependent sites.

So would you consider using absolute/relative positioning for this site or stick with float/relative positioning?
LayneMitch is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 11:09 AM Re: Float vs. Absolute (Which Would You Use?)
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
First of all, the reason you can't resize anything on that site (other than the intro page) is because the site was done in Flash, not vanilla HTML.

Second, that's not a site you should copy any design ideas from, because if it were really working for the owners there wouldn't be keywords stuffed into a hidden span.

Third, learning how to hand-write code is the smartest thing you can do, and once you figure it out, the need for a useless POS like Dr*amw*av*r will be minimized.

Fourth, it really depends on what you're trying to accomplish as to whether positioning vs. floats is necessary. Floats, for the most part, are the way to go: however, certain elements can require absolute/relative positioning. The only way to get an answer to your question will depend on what it is you're trying to do. I personally use both all the time: I absolutely position header elements, and sometimes menus, since they're the last thing on a site that needs to be displayed (after content, etc.), and it works fine, just fine.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-21-2007, 03:07 PM Re: Float vs. Absolute (Which Would You Use?)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
I'm with these guys... floats and margins are the way to go, position only when you have to. I typically use positioning for address blocks (depending on the layout), logos, and other smallish items. Some dropdown menus need positioning to work properly. Other than that, I don't use positioning much except I always set my overall "wrapper" div to position:relative so if I have to position something else, it's relative to the wrapper and not the body.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 04:08 PM Re: Float vs. Absolute (Which Would You Use?)
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
I avoid position:absolute as much as possible. Most things can be done without it. Going with the natural flow of the document is a good idea in most cases. I am glad you are trying to layout your pages with css rather than tables. Props for that!
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 08:28 PM Re: Float vs. Absolute (Which Would You Use?)
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I'm going to agree as well. It is ok to use positioning. I've used it and will use it again, but generally you'll find it easier to build and maintain sites using floats.

A big part of the trick to laying out a site with css is realizing you don't have to use much floats or positioning. It's usually only a few key elements on the page that need a float and the rest gets to stay in the normal document flow.

The truth is there's no one right way to build a site. I'm with everyone above in suggesting floats over positioning. It can take a little time to get used to them in the beginning, but it's worth the time. In the end you'll develop your own style of coding.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-22-2007, 01:28 PM Re: Float vs. Absolute (Which Would You Use?)
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Just wanted to say thank you for the different views to all of you. I have a much better idea of how to approach web design now.
LayneMitch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Float vs. Absolute (Which Would You Use?)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31258 seconds with 12 queries