| | |
div align=center
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
What is the difference between <div align="center"> and <div style="text-align:center"> aside from the obvious difference that the latter is CSS?
well, I've experimented with it a little before and validated it, aligning a div is not valid strict xhtml 1.0 anyways heh
. Other than that I don't know, I know I had different results when I used the div align but none that would make sense. E.g. I set the text-align in my stylesheet to right, this worked but I set the div align to bottom, nothing happened with the text but an image I had in the same div was aligned to the top
. Other than that I'm not sure, I think that text-align only applies to text.
once again, my opinion is much ado about nothing.
. Other than that I don't know, I know I had different results when I used the div align but none that would make sense. E.g. I set the text-align in my stylesheet to right, this worked but I set the div align to bottom, nothing happened with the text but an image I had in the same div was aligned to the top
. Other than that I'm not sure, I think that text-align only applies to text.once again, my opinion is much ado about nothing.
Formerly known as Slade.
Well, in that example there is no difference, it's just part of a push away from using html attributes for style and towards css.
IF I understand right the current movement is towards having the HTML (to be replaced by XML) describing only the actual content. Then how it is represented on the screen would be described in the css. This way if you only need one data file when using the same content in different ways ex: display on a computer monitor/cell phone/pda/import it into a database, etc....
Of course this only applies when you use an external stylesheet, not when you have the style embedded right in to the tag. I suspect this will one day be depricated as well and is only allowable now to make it easier for people to transition from the old way to the new.
IF I understand right the current movement is towards having the HTML (to be replaced by XML) describing only the actual content. Then how it is represented on the screen would be described in the css. This way if you only need one data file when using the same content in different ways ex: display on a computer monitor/cell phone/pda/import it into a database, etc....
Of course this only applies when you use an external stylesheet, not when you have the style embedded right in to the tag. I suspect this will one day be depricated as well and is only allowable now to make it easier for people to transition from the old way to the new.
•
•
Join Date: Nov 2003
Posts: 207
Reputation:
Solved Threads: 1
I don't think align="" is valid XHTML 1.0 coding. style="text-align: " is, however.
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Solved Threads: 0
text-align CSS property applies only to the content and not the container. float property helps align the container but has no 'center' attribute. Many have suggested work around methods, which do not work uniformly in all browsers. Perhaps a combination attributes relating to margin, position, and container width could provide a way out. Will appreciate suggestions that address this issue
align= is deprecated.And the W3C clowns gave us no good way to center images in nondeprecated ways. They are thinking book and newspaper layout, where images are never centered.
So I do this:
HTML and CSS Syntax (Toggle Plain Text)
<style type="text/css"> .cenx {text-align: center;} .ceni {clear: both;} .bxfix {margin: none; border: none; padding: none;} img {padding: 12px;} body {padding: 5%;} </style>
HTML and CSS Syntax (Toggle Plain Text)
<div class="bxfix cenx"> <img src="mine.jpg" alt="my mine" class="ceni" /> </div>
Last edited by MidiMagic; Jul 13th, 2007 at 6:09 am.
Daylight-saving time uses more gasoline
![]() |
Similar Threads
- div align="center" (HTML and CSS)
- [CSS] How to center one div in a main div (HTML and CSS)
- How to have the div layer center on any browser? (JavaScript / DHTML / AJAX)
Other Threads in the HTML and CSS Forum
- Previous Thread: Javascript / css menu image help, pls?
- Next Thread: Doctype difficulties
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






