Re: making a bottom margin



Spartanicus wrote:
meltedown <groups2@xxxxxxxxxx> wrote:


Again: (a) Floats are for having inline content flow beside and beneath
the floated element.

Floating is *not* a method to align elements.
Floating is *not* an appropriate method to create a "CSS layout".

If possible floats should be avoided except when used for their intended
purpose (a).


So the obvious question is: if I want to align elements, and I don't want the content to flow beside and beneath anything, should I just tables ?


Tables are for marking up tabular data, not for formatting or layout.

Left aligning is the default for block level elements, use margins if
you want to right align a block level element, like so:
<div style="width:50%;margin-left:auto">foobar</div>

Right aligning inline level content is done with the text-align
property, like so:
<p style="text-align:right">Some text.</p>

Like my home page, which has 3 columns, floated but not flowing. I don't wnat it to flow. So should I just put the 3 columns in a table ?


There are 2 proper ways to create a 3 column "CSS" layout: by using
absolute positioning or by using a CSS table. It should be noted that IE
doesn't support CSS tables. This has led to the widespread abuse of
floats, despite the fact that doing so causes a myriad of problems.
Floats used to create a "layout" is a hack, and a nasty one.

Well thanks for clarifying. I always thought tha absolute positioning was something to be be avoided. Not that I figured that out myself, its read in books, on web pages and in this newgroup. ( a couple years ago).
It seems the advice is constantly changing.
I just wish I could learn how to make css layouts without it being a night mare everytime I try to do anything.



Like with floats, absolute positioning has the disadvantage that the positioned elements are removed from the flow, this limits the layout options, usage of for example a footer directly below the content may not be an option.

.



Relevant Pages

  • Re: Why cant I make a table cell any size I want?
    ... > Tables are intended to present tabular data, and as such, one would expect ... > that you should use CSS and the div and span tags. ... if I use flow don't I then need to use tables for page layout? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dynamic box layout question
    ... Nope, floats are not really suitable for creating layouts, they are ... sometimes used to get around IEs poor CSS support. ... layout are a major source of frustration for budding CSS'ers because of ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: How do I create continuous section breaks within columns?
    ... want (using numbers to indicate text flow)? ... With the Compatibility option cleared: ... >> Stefan Blom ... >>> layout and create a continuous section break, ...
    (microsoft.public.word.pagelayout)
  • Re: how can I put an element below another element, thats not absolutely positioned?
    ... this I can do easily with position:absolute, however, due to the flow ... I don't think you can do it with position absolute, ... but I don't know that much CSS to even try. ... z-index: 10; ...
    (comp.lang.javascript)
  • Re: making a bottom margin
    ... Floats are for having inline content flow beside and beneath ... >> the floated element. ... >> If possible floats should be avoided except when used for their intended ...
    (comp.infosystems.www.authoring.stylesheets)