By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

What's the difference between float and align?

P: n/a
Hello,

Just wondering what the difference is between "float" and "align"? If I
align a picture to the left, is that not the same as floating it? Can align
and float be used together or do you use one or the other?

Thanks for your replies...

Viken
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
In our last episode,
<e6********************@comcast.com>,
the lovely and talented Viken Karaguesian
broadcast on comp.infosystems.www.authoring.stylesheets:
Hello, Just wondering what the difference is between "float" and "align"? If I
align a picture to the left, is that not the same as floating it? Can align
and float be used together or do you use one or the other? Thanks for your replies...


The main difference is that in CSS 1 & 2 there is no property
"align" whereas the property "float" exists. The property
"text-align" applies to the *content* of a box, while "float"
applies to the box itself.

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
An effective way to deal with predators is to taste terrible.
Jul 21 '05 #2

P: n/a
> The main difference is that in CSS 1 & 2 there is no property
"align" whereas the property "float" exists.
Is "align" an HTML tag, then? And would it be the same as "float"?

The property
"text-align" applies to the *content* of a box, while "float"
applies to the box itself.

--
Lars Eighner ei*****@io.com
http://www.larseighner.com/
An effective way to deal with predators is to taste terrible.

Jul 21 '05 #3

P: n/a
Viken Karaguesian wrote:
The main difference is that in CSS 1 & 2 there is no property
"align" whereas the property "float" exists.

Is "align" an HTML tag, then? And would it be the same as "float"?


It's an HTML *attribute*--a deprecated one. Only when used with TABLE
and IMG and set to certain values, it has the same basic function as CSS
float.
Jul 21 '05 #4

P: n/a
in comp.infosystems.www.authoring.stylesheets, Viken Karaguesian wrote:
Hello,

Just wondering what the difference is between "float" and "align"?
Float means same every time, align means different things when used on
different elements or values.
If I
align a picture to the left, is that not the same as floating it?
Not always, but should be.
Can align and float be used together
Yes,
or do you use one or the other?


Use float, and of course text-lign and margin instead of align.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #5

P: n/a
On Wed, 23 Mar 2005 01:22:58 -0300, Lars Eighner <ei*****@io.com> wrote:
The main difference is that in CSS 1 & 2 there is no property
"align" whereas the property "float" exists. The property
"text-align" applies to the *content* of a box, while "float"
applies to the box itself.


True. As a side note: in IE 5.5, you can use text-align to float boxes.
This is not a feature, this is a bug.
--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #6

P: n/a
In our last episode, <bp********************@comcast.com>, the
lovely and talented Viken Karaguesian broadcast on
comp.infosystems.www.authoring.stylesheets:
The main difference is that in CSS 1 & 2 there is no property
"align" whereas the property "float" exists.
Is "align" an HTML tag, then? And would it be the same as "float"?


"ALIGN" is a deprecated HTML attribute. It was applied to many
different elements. In some contexts it was supposed to be
similar to the style float. In others it was supposed to be
like text-align. As it was rendered in some browsers, it looked
like both float and text-align. That is <DIV ALIGN="center">
in many browsers would both center the DIV and everything
within it. In other words, it would take the place of the
really, really deprecated <CENTER> tag in some browsers.

Interpretations of the ALIGN attribute still vary according
to element and browser. The css properties float and text-align
are now more consistently rendered by more (current) browsers
across more (appropriate) elements than ALIGN ever was. So
I suggest that instead of trying to untangle ALIGN, use css
to get a better chance of having what you want in more browsers.
The property "text-align" applies to the *content* of a box,
while "float" applies to the box itself.


--
Lars Eighner ei*****@io.com http://www.larseighner.com/
"I have never made but one prayer to God, a very short one: 'O Lord,
make my enemies ridiculous.' And God granted it." --Voltaire
Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.