1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS Layout Problem In FireFox

Discussion in 'CSS' started by programmer, Aug 28, 2005.

  1. #1
    I want my contents right in the middle of page weather the screen resolution is 800x600 or
    higher. For that purpose i put one div as wrapper of page and set its text-align property
    center so the next contents can remain right in the middle. Now i put an other div
    in it with text-align property set to left-align. Now what should happen is that due to
    first div's text-align->center property the second div should apper in the middle but due
    to second div's text-align->left property the contents should set to left. It is working fine
    in Internet Explorer but Firefox is still display second in left.

    the code is as following

    <html>
    <head>
    <title>Welcome To My Webpage</title>
    <style>
    
    #w
    {
     height: 100%;
     width: 100%;
     text-align: center;
     border: 1px solid red;
    
    }
    
    #main
    {
     
     width: 740px;
     text-align: left;
     border: 1px dashed green;
    
    }
    
    
    </style>
    </head>
    
    <body>
    
    <div id='w'>
    
    <div id='main'>Welcome</div>
    
    </div>
    
    </body>
    </html>
    HTML:
     
    programmer, Aug 28, 2005 IP
  2. Arnica

    Arnica Peon

    Messages:
    320
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just put 'margin:auto;' into the #main div.

    Mick
     
    Arnica, Aug 28, 2005 IP
  3. programmer

    programmer Guest

    Messages:
    444
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks - the problem is solved :)
     
    programmer, Aug 28, 2005 IP