|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Centering divisions without alignThis is a discussion on Centering divisions without align within the HTML & CSS forums. Topic: Lets say i have a division Code: <div style="width: 700px; text-align: left;">hi!</... |
![]() |
![]() |
|
![]() |
LinkBack | Thread Tools | ![]() | Display Modes | ![]() |
|
|
#1 (permalink) |
|
Lets say i have a division
Code:
<div style="width: 700px; text-align: left;">hi!</div> Any help would be appreciated, thanks in advance.Edit: margin: auto; works for Firefox but doesn't seem to do anything in IE7.
__________________
This signature intentionally left blank. Last edited by ahamilton9; 02-03-2007 at 09:00 PM.. |
|
|
|
|
|
|
#2 (permalink) |
|
add
Code:
text-align: center; and try using Code:
margin: 0 auto;
__________________
/* hide the tables */ table { visibility: hidden; } /* gone! */ www.cycadelic.org |
|
|
|
|
|
|
#3 (permalink) |
|
Neither work.
I'll stick with align="center" but I seriously think whomever is specifically in charge of XHTML and CSS standards via W3C or such needs to step down. A simple "element-align: ~~~;" or general "align: ~~~;" that would apply to all elements would solve so many problems, including the misuse of float... you can't deprecate something without putting a complete alternative out there.
__________________
This signature intentionally left blank. |
|
|
|
|
|
|
#4 (permalink) |
|
Use this as your CSS
Code:
<style>
* {
margin: 0;
padding: 0;
}
body {
text-align: center;
}
div#main {
margin: 0 auto;
text-align: left;
width: 700px;
}
</style>
This works on IE, Firefox and Opera
__________________
/* hide the tables */ table { visibility: hidden; } /* gone! */ www.cycadelic.org |
|
|
|
|
|
|
#5 (permalink) |
|
I'm not sure but I think this is the easiest:
Code:
<center> Centar this txt baby! :D</center> .Ofcourse if only works for the txt witin the <center></center> tags, If you want to get all the txt you made centerd, CSS is the only way out .Code:
<style type="text/css">
p {
text-align: center;
}
</style>
. |
|
|
|
|
![]() | ![]() | ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Free Wordpress Theme – Tranquil Divisions | voidix | Web Design Resources | 0 | 08-24-2007 01:08 AM |
| Centering Text in PHP.GD Images | Retire at 21 | Coding Tutorials | 0 | 12-10-2006 01:27 PM |