473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

What's the difference between float and align?

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
6 12421
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
> 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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jeff Thies | last post by:
I have a series of blocks that are float left that I need centered on the page. <div class="center" align="center"> <div style="width: 100 px;float: left">thumbnail 1</div> <div style="width:...
1
by: Alan Silver | last post by:
Hello, I have a page in which I'm trying to give the user the chance to manipulate a list of items. These are the price variations for a product, so each item consists of a name (eg, small,...
4
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this...
1
by: pamate | last post by:
Hi all, I am creating tables using CSS ( tag).I am facing problem of width . I am giving 70% and 30% width to the respective div`s but it showing me difference in IE and Mozilla its not showing...
7
by: Nouman6 | last post by:
Hey everyone, my first post here :D I am new to the css style of making a web page. I usually just use the html and iframe method. my problem is...I don't really know HOW to use php and css...
6
by: Christopera | last post by:
I built a this sites http://www.ourzeal.com/walko/index.html . If you look closely at the far right column it is about 1 px higher than the other two. The source does validate. I can not however...
27
by: GloStix | last post by:
WARNING VIDEO TAKES A WHILE TO LOAD http://screencast.com/t/BWQ6DNtsM I really don't know how to fix this other than putting another div. But I dont' exactly want to do that for every page....
5
by: vegetable21 | last post by:
Hi All, (I originally posted this in the .NET Programming Languages, but i realised the fact that i'm using C# is irrelevant as i think the problem i'm having is with DHTML / JavaScript.) So...
2
by: shannona | last post by:
I've been banging my head against an interaction between a table and float element. I want the two of them to together take up 100% of the width of their container. If the table cells' content...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.