Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,517 members, 7,836,973 topics. Date: Wednesday, 22 May 2024 at 03:12 PM

How Can I Center The Main-container In This HTML Layout ? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How Can I Center The Main-container In This HTML Layout ? (1139 Views)

Notice the nairaland layout changes / Next Level Layout GUI / Pls Help A Beginner In This HTML (2) (3) (4)

(1) (Reply) (Go Down)

How Can I Center The Main-container In This HTML Layout ? by furaoing: 5:15pm On Jun 27, 2017
For the desktop browser version of this site, I did set a maximum-width limit on the div that is the main-container (class="main-container"wink of the webpage. However, I did not know how to center this element to the center of the screen. Currently it is positioned at the left side of the screen. Any ideas ?


webpage address (Desktop webpage, not mobile !):
http://www.nigeria123.net/

Re: How Can I Center The Main-container In This HTML Layout ? by Nobody: 5:28pm On Jun 27, 2017
Set the div's right and left margins to auto.
Re: How Can I Center The Main-container In This HTML Layout ? by Kingpinukecy(m): 5:32pm On Jun 27, 2017
furaoing:
For the desktop browser version of this site, I did set a maximum-width limit on the div that is the main-container (class="main-container"wink of the webpage. However, I did not know how to center this element to the center of the screen. Currently it is positioned at the left side of the screen. Any ideas ?


webpage address (Desktop webpage, not mobile !):
http://www.nigeria123.net/

Try dis and see
i don't knw if u r using CSS TO style d HTML webpage. if yes, apply dis formating to it.
body{
margin:0px;
padding:0px;
}
.main-container{
width:980px;
margin: 0px auto;
}
Dat is all d margin aspect will help to centralize d page ..Auto means setting left n right to center by d browser.

U can contact me anytime u like for any help including java programming. # zero seven zero,three zero six,five two two, zero three
Re: How Can I Center The Main-container In This HTML Layout ? by Nobody: 7:37pm On Jun 27, 2017
create a div and set thhe class to container in html, then set the margin to auto in css
div class="container" then let overflow be hidden
.container{
margin:auto;
overflow:hidden;}

(1) (Reply)

Need Help With Code Igniter - Beginner / Need A PHP God With Mobile App Knowledge. / Do You Want To Sell Your Website?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.