smonkcaptain Posted November 27, 2011 Share Posted November 27, 2011 Hey all, If you visit my website here: www.flightphotos.net You will see that i have centered the logos and content. If you have a smaller resolution or resize the window so it's small, the content stays centered until the page width is smaller than the content width. How can i ensure the content is always say 40 px from the left, so it appear centered even when the window is resized? Thanks, Jimmy. Link to comment https://forums.phpfreaks.com/topic/251899-centering-regardless-of-window-size/ Share on other sites More sharing options...
Frank P Posted November 27, 2011 Share Posted November 27, 2011 Quote How can i ensure the content is always say 40 px from the left, so it appear centered even when the window is resized? That's a contradiction in terms. You're making a couple of mistakes, and I'm not quite sure what you're trying to achieve. You might wanna start with this tutorial, and see what problems remain after that: How to Center in CSS. Link to comment https://forums.phpfreaks.com/topic/251899-centering-regardless-of-window-size/#findComment-1291640 Share on other sites More sharing options...
Glese Posted December 3, 2011 Share Posted December 3, 2011 The whole page is not fully centered, but a bit off. You can achieve what you are trying to achieve by doing the following: body { margin-left: 40px; } Link to comment https://forums.phpfreaks.com/topic/251899-centering-regardless-of-window-size/#findComment-1293834 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.