Solved

center wordpress theme

Posted on 2014-04-21
5
428 Views
Last Modified: 2014-05-03
Hi,

I try to center my wordpress theme like this code below
However when I resize the browser part of the right hand screen goes off the browser so this is no good and this doesnt center the webpage in full size.

How do i center the website and keep it centered on resize in wordpress twentyfourteen

.site {
	
	max-width: 960px;
	position: relative; left:10%;
	
}

is this how it is done?

#page {
/*background-color:white;*/
border:1px solid #959596;
margin:0 auto;
padding:0;
max-width:760px;
}
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 40012095
Add margin:0 auto; to your .site class.

HTH,
Dan
0
 
LVL 16

Expert Comment

by:HagayMandel
ID: 40012096
site {
      width: 960px;
      max-width: 960px;
      margin-left: auto;
      margin-right: auto;      
}
0
 

Author Comment

by:jagguy
ID: 40012165
this doesnt work as the right side wont resize properly.
I cant use this
.site {
      width: 960px;
      max-width: 960px;
      margin-left: auto;
      margin-right: auto;      
}

this works so what is the problem with this code?
#page {
/*background-color:white;*/
border:1px solid #959596;
margin:0 auto;
padding:0;
max-width:760px;
}
0
 
LVL 15

Accepted Solution

by:
eemit earned 500 total points
ID: 40020795
Try to set max-width also for .site and .site-header css classes e.g.:
.site,
.site-header {
	max-width:760px;
}

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question