際際滷

際際滷Share a Scribd company logo
Centering content
                Put all your content - every single thing inside

1               the <body></body> element - in a div.
                Name the div wrapper.
<body>

<div id=wrapper>
  <p>Call me Ishmael. Some years ago -- never      Definitely comment the closing of the
  mind how long precisely -- having little or no   div, or you will regret it later.
  money in my purse, and nothing particular to
  interest me on shore, I thought I would sail
  about a little and see the watery part of the
  world.</p>

</div><!-- end wrapper -->
</body>
Centering content
                In the <head></head> of your page, add CSS

2               styles to the div with the id of wrapper


<style type=text/css>
                                         Call me Ishmael. Some years ago -- never mind
#wrapper 	{                              how long precisely -- having little or no money
                                         in my purse, and nothing particular to interest

	 width: 900px;                          me on shore, I thought I would sail about a little
                                         and see the watery part of the world.


	 margin:0 auto;
	}
</style>

More Related Content

Centering page

  • 1. Centering content Put all your content - every single thing inside 1 the <body></body> element - in a div. Name the div wrapper. <body> <div id=wrapper> <p>Call me Ishmael. Some years ago -- never Definitely comment the closing of the mind how long precisely -- having little or no div, or you will regret it later. money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.</p> </div><!-- end wrapper --> </body>
  • 2. Centering content In the <head></head> of your page, add CSS 2 styles to the div with the id of wrapper <style type=text/css> Call me Ishmael. Some years ago -- never mind #wrapper { how long precisely -- having little or no money in my purse, and nothing particular to interest width: 900px; me on shore, I thought I would sail about a little and see the watery part of the world. margin:0 auto; } </style>