Struggling with centering my webpage using CSS:
CSS code snippet:
#wrapper {
margin-left:auto;
margin-right:auto;
width: 100px;
}
#welcome {
position:absolute;
top:202px;
width:560px;
height:224px;
z-index:2;
}
#newsSection {
position:absolute;
left:576px;
top:209px;
width:380px;
height:600px;
z-index:2;
}
HTML structure:
<body>
<div id="wrapper">
<div id="welcome">
//content here
</div>
<div id="newsSection">
//content here
</div>
</div>
</body>
Having trouble centering the whole page except for the #newsSection div.
The "left:576px" on #newsSection is there to align it next to #welcome. But when I resize the browser, #newsSection overlaps with #welcome. Removing "left:57px" makes them overlap completely...
Looking for a solution. Thank you