Jump to content

[SOLVED] all page content goes left


ballouta

Recommended Posts

Hello

 

I have a tables full with tables and few css code, it looks normall on Internet explorer but when i opened it on FireFox, it went all to the left.

 

I added a div after the body tage directly <div align='center'> and closed it at the end before </body>

but the page still on the left on firefox.

 

is there a quick way to make it all centered even by CSS please?

 

thank you

Link to comment
Share on other sites

use <div style='margin: 0; width: 960px; auto;'> instead. (adept width to what you're after)

 

Or the better way (think it makes sure it works in IE 5.5 or something.. forgot why I'm always using it...)

body
{
  text-align: center;
}
#container
{
  margin: 0 auto;
  width: 960px;
}

<div id='container'>

 

 

Link to comment
Share on other sites

Simple example guaranteed to work:

<html>
<head>
  <title>Example of center alignment</title>
  <style type="text/css">

  body { text-align: center; }
  /* undo center alignment for normal use */
  body * { text-align: left; }
  #container
  {
    margin: 0 auto;
    width: 960px;
  }
  </style>
</head>
<body>
  <div id="container">
<!-- Table with nonsense contents -->
<table><tr><td>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu ipsum. Nulla facilisi. Curabitur at urna. Maecenas lobortis nisi a est. Nunc vestibulum sem at ligula. Nulla dignissim turpis nec est. Proin augue magna, aliquam hendrerit, feugiat ut, pharetra eu, turpis. Curabitur dictum nisi vel ante. Proin ac tortor. Ut placerat nibh non dolor. Aliquam nulla dui, dignissim id, vulputate sed, ultricies dignissim, enim. Duis ut urna. Nullam ornare mi sit amet urna. Nunc placerat. In hac habitasse platea dictumst. Proin tellus nulla, posuere quis, sollicitudin eu, porta eu, felis. Phasellus vehicula dui ut lacus. Donec velit odio, rhoncus et, tempor sed, adipiscing sed, arcu. Phasellus id quam.

Nulla elementum magna ac nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris feugiat odio. Integer consectetur elit sit amet sem. Nulla placerat mattis lorem. Proin dictum lacinia est. Morbi id ante. Quisque risus. Nam sagittis convallis orci. Duis hendrerit, enim et auctor dapibus, risus risus sagittis arcu, ut lacinia urna nibh sit amet diam. Suspendisse luctus, augue a commodo eleifend, est massa sollicitudin augue, quis auctor ante mauris id augue. Aenean rhoncus leo sit amet eros. Morbi libero quam, venenatis ut, vehicula sed, semper vel, tortor. Etiam mollis euismod risus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc elit lorem, euismod vel, tempus sed, dictum vitae, est.

Praesent dictum imperdiet velit. Etiam quis nulla. Integer at felis. Nunc auctor feugiat erat. Etiam orci turpis, congue at, dictum sit amet, sollicitudin id, velit. Quisque euismod porttitor nisi. Nunc laoreet tincidunt elit. Ut malesuada orci eget mauris. Donec molestie. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla viverra ultricies sapien.

Maecenas convallis. Donec auctor. Integer bibendum risus sit amet risus. Etiam vulputate. Proin auctor dictum est. Cras nunc magna, adipiscing in, facilisis eget, vestibulum a, metus. Nulla sapien. Curabitur non mi sed lorem accumsan molestie. Duis suscipit viverra urna. Praesent ut dolor non lacus commodo molestie. Duis eu nibh ac nulla mollis viverra. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis tincidunt, magna at feugiat ullamcorper, risus lectus viverra elit, eget gravida lorem elit ac sapien. Sed pharetra magna ac nunc. In consequat consectetur arcu. Etiam lobortis tincidunt libero. Sed nec ipsum.

Morbi bibendum mattis mauris. Sed luctus mollis eros. Duis accumsan enim sit amet mauris. Nullam posuere, sapien nec tempor fermentum, nunc tortor commodo velit, id mollis libero sem ut ligula. Ut vel leo. Sed bibendum odio a augue. Nullam vestibulum. Curabitur rhoncus rhoncus metus. Vivamus quis leo in neque dignissim rhoncus. Fusce velit. 
</td></tr></table>
<!-- end table -->
  </div>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.