Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

center wordpress theme

Posted on 2014-04-21
5
Medium Priority
?
432 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 2000 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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 purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

610 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