Hello;
I am working on a web page that I have designed to take up 75% of the monitor.
Presently this web page when loaded auto aligns to the left side of my monitor.
While it looks fine I would prefer it to be centered on my monitor. I have tried writing a code that will center my web page but am having no luck.
I'm sure that it is a simple fix but I can't seem to get it to work.
Anyone out there know what code I should use to center my web page?
Thanks.
Griffin54
0
Light Poster
Recommended Answers
Jump to PostHave you tried
margin: auto;
on your outer div?
Jump to PostCreate two divs, outer and inner div. The inner div goes inside of the outer div...
<div class="outerDiv"> <div class="innerDiv"> your main content </div> </div>
CSS
.outerDiv {width:75%;margin:auto;}
.innerDiv {style as you would normally for your content}
All 6 Replies
pritaeas
2,179
¯\_(ツ)_/¯
Moderator
Featured Poster
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
Alaister
0
Newbie Poster
shahbaz13
0
Light Poster
gabrielcastillo
40
Web Developer
lps
71
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.