473,785 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12447
In our last episode,
<e6************ ********@comcas t.com>,
the lovely and talented Viken Karaguesian
broadcast on comp.infosystem s.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.infosystem s.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************ ********@comcas t.com>, the
lovely and talented Viken Karaguesian broadcast on
comp.infosystem s.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
15031
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: 100 px;float: left">thumbnail 2</div> <div style="width: 100 px;float: left">thumbnail 3</div> </div>
1
2296
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, medium, large), a price, a checkbox to say whether or not the variation is on special offer and a special price. I can pull the values out of the database OK and display them in a repeater. What I want to do is have a set of controls below the...
4
1922
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 post. Basically, this will work correctly if I remove all non-form related tags from the form =eg span, div, but I want to format the form all pretty like so??? Right now, it only collects 2 parts of the form fields =sites &
1
2684
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 the same width on both browser. Copy paste the following code to view the problem - <html> <head> <title>Tables Through CSS</title> <style type="text/css">
7
1986
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 together. I am trying it and so far so good except one thing. I dont think it's correct xD and I cant get a div to go where I want it to or check with the css for it's style. IF YOU DONT WANT TO READ ALL OF IT GO DOWN FOR A LINK TO DOWNLOAD THE...
6
1888
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 get this column fo level out. Any help would be much appreciated. Right click to view source and the CSS looks like this: body { background-color: #000; margin: 10px 0px 0px 0px; } h1 { font-size: 15px; } #block_1 { width: 800px;
27
3880
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. random div's everywhere Is there any other way? Also I'm trying to get a scaled thumbnail of the orginal picture WHILE maintaining the size of the css box.. Is that possible? Or do I have to scale it in Photoshop and make a separate image =\
5
2024
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 here goes again: I'm writing an app in C# that will be doing a bit of web scraping. I've got a fair bit of expierence with this but i've come across an issue with the returned HTML i'm getting from the pages. When i view the page i'm trying to...
2
8184
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 were to wrap around the float, even better, but that's not necessary. However, I'm continuously running into two issues: 1.) If I make my table 100%, it writes over the float: right for tables where the content text is long enough. 2.) If I...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9485
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.