Explore Courses Blog Tutorials Interview Questions
0 votes
in Web Technology by (20.3k points)

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.

1 Answer

0 votes
by (40.7k points)

Try using the code given below:


    <div style="width:800px; margin:0 auto;">

        centered content



Browse Categories