Jump to content

[solved] Aligning Whole Website.


Distortion

Recommended Posts

On some websites, for example w3schools.com, when you make the browser window smaller the centered area where the content is jumps to the left.So there is more room for the website. When you press fullscreen again the website jumps back to the middle of your screen.How do I do that?

Link to comment
Share on other sites

If the content has fixed width and is centered, it will do that.Try this and see how it works:

html,body {  margin: 0;  padding: 0;  text-align: center;}#content {  width: 960px;  height: 200px;  margin: 0 auto;  text-align: left;  border: 1px solid black;}

<div id="content">Some content</div>

Link to comment
Share on other sites

You can do it with percentages, too. If you want the body to be 80%, you just give it margin-left 10% (half the remainder), or just margin: 0 auto should work, too.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...