Back
I have a div tag with a width set to 800 pixels. When the browser width is greater than 800 pixels, it shouldn't stretch the div, but it should bring it to the middle of the page.
Try using the code given below:
<body> <div style="width:800px; margin:0 auto;"> centered content </div></body>
<body>
<div style="width:800px; margin:0 auto;">
centered content
</div>
</body>
31k questions
32.8k answers
501 comments
693 users