Solved

center wordpress theme

Posted on 2014-04-21
5
427 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bootstrap wrap text 1 36
htaccess block all countries but the US 4 42
White space in figure / img 4 22
Wordpress navigation menus do not show up 14 21
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

730 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