|
|
|
|
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post
#1
Oct 30 2008, 07:04 PM
I remember learning this so long ago after piecing together some tutorials. First , put together your basic HTML Code. Nothing complicated , but it should probably look like this; [codebox]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <title>Your Site Name</title> </head> <body> <div id="layout"> All but All content should be here </div> </body> </html> [/codebox] The ID is important. It doesn't matter what you ID/Class it as , as long as it has a value/Id Open a new CSS file , or make a new one in notepad [codebox] body { text-align: center; } #container { margin: 0 auto; width: abcpx; text-align: left; } [/codebox] Body defines the entire document. The Body text align; center is used for the general code.The container tag defines the container ID we declared earlier That's essentially it. There are several other tweaks , but aren't really neccesary. Hoping I helped in some way , Encryptedwrath NOTES: 1) The text align is compulsary for IE users. Other browsers display the code fine without it This post has been edited by encryptedwrath: Oct 30 2008, 07:19 PM |
![]() ![]() Group: Members
Posts: 31 Joined: 22-November 07 From: Belgrade, Serbia Member No.: 53,492 myCENT:96.64 |
Post
#2
Oct 30 2008, 07:12 PM
I would just like to add why it is necessary to use text-align: center. If you tried creating a layout with that line of CSS code, everything would look fine in Opera and Firefox, which is how it should work. However, in IE, it would not. That's why you have to add text-align: center, which, oddly enough, helps. Why oddly enough? Well, the name says it all - text-align, not div-align. After all, it's Microsoft we are talking about and their lack of respect for WWW standards.
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
0 | Trystim | 3,498 | 20th September 2004 - 02:52 PM Last post by: Trystim |
|||
![]() |
4 | BoSZ | 9,085 | 21st October 2004 - 09:43 PM Last post by: Jeremie |
|||
![]() |
1 | faceofdie | 6,128 | 17th November 2004 - 06:47 PM Last post by: serverph |
|||
![]() |
10 | serverph | 1,436 | 15th July 2007 - 12:47 AM Last post by: homespeaker |
|||
![]() |
3 | MSTR | 3,364 | 11th December 2004 - 10:28 AM Last post by: wassie |
|||
![]() |
8 | Graeme | 1,019 | 2nd July 2007 - 12:31 PM Last post by: Graeme |
|||
![]() |
47 | finaldesign | 13,947 | 22nd April 2005 - 09:58 PM Last post by: finaldesign |
|||
![]() |
10 | darran | 1,528 | 10th February 2009 - 04:11 AM Last post by: novoAlias |
|||
![]() |
8 | googlue | 4,151 | 27th January 2005 - 08:10 AM Last post by: googlue |
|||
![]() |
0 | dark | 2,470 | 27th January 2005 - 06:13 PM Last post by: dark |
|||
![]() |
1 | mahesh2k | 4,328 | 19th February 2005 - 03:59 PM Last post by: Klas2B |
|||
![]() |
8 | encryptedwrath | 872 | 2nd January 2009 - 08:45 AM Last post by: triplebtalk |
|||
![]() |
8 | soulnetwork_tk | 3,303 | 8th March 2005 - 08:19 PM Last post by: soulnetwork_tk |
|||
![]() |
13 | the_furious1 | 7,922 | 22nd March 2005 - 04:52 PM Last post by: Becca |
|||
![]() |
3 | electriic ink | 924 | 28th May 2006 - 04:41 AM Last post by: OpaQue |
|||
|
Open Discussion | Time is now: 22nd November 2009 - 09:50 AM |
Web Hosting Powered by ComputingHost.com.