tags:

views:

169

answers:

3

Can we make cross browser css layouts with CSS positioning, without using float? What are the bad and good points of usin css positioning over Float+margin+padding? I want to make layout compatible with all A-Grade Browser and with IE6 Also? IN dreamweaver we have a layer functionaliy to make css layout quickly but it's uses absolution position. is this technique bad?

+1  A: 

If you don't care how it looks if the browser is larger or smaller than you designed for then absolute positioning it great. :)

But, in most cases, if you are designing for a browser that may be on a 17" - 30" monitors, so it may be fullscreen, then float is helpful.

Now, if you are changing the positions to scale to the size of the window dynamically, and can handle a resize, then absolute will work well.

I think absolute positioning would be more work than it is worth, if you want to get rid of float.

James Black
mostly i make website with around 900 px fixed width size so in this condition is positioning is time save than float? I make design for cms like wordpress, joomla etc. but i use em in font-size not pixel. i make accessible layouts
metal-gear-solid
If you are forcing your main div to be a fixed width then absolute positioning would be fine, as you can just place the components where you want them, but, I am annoyed when I have to adjust my browser to match the designed width that is imposed.
James Black
so there is no problem to make fixed width design with abs positioning?
metal-gear-solid
There is no problem as long as you accept that it will look odd to users with wider browsers.
James Black
+1  A: 

When I put together a page, I consider the elements I am putting together and the kind of physical structure they form. If elements are lined up together, like a row of books, I will use floats to "press" them up against one another. If I have more sparse elements, like post-it notes on a sheet of paper, I will use absolute positioning because the position of one element is not closely tied to the position of another.

I also look at what I know about the elements and what I don't. If I have things that change in size, like elements with varying amounts of content in them, I will use floats to position them. This way the elements still "stack" up together in some orderly fashion. Positioning an element of arbitrary size can be tricky, since you can end up exceeding a container's boundaries and breaking a layout or displaying/hiding some content in a place you don't want it.

Of course, you can combine the two techniques together, too - it's all about what you need to put together.

Frank DeRosa
if we mix float with positioning will it create any problem with font resizing?
metal-gear-solid
+1  A: 

Can we make cross browser css layouts with CSS positioning, without using float?

Certainly, if you like. Floats and positioning are just two more CSS properties, they are not mutually exclusive. For complex layouts you may often be mixing both.

IN dreamweaver we have a layer functionaliy to make css layout quickly but it's uses absolution position. is this technique bad?

Yes. Except for things that are naturally fixed-size like images, using exact page-pixel absolute positioning is a bad move, one that automated tools tend to produce because it's easy to do with a WYSIWYG interface but one which degrades badly for text.

bobince