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
Solved

center wordpress theme

Posted on 2014-04-21
5
426 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
5 Comments
 
LVL 34

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP AJAX JSON 2 77
Changing Color of Page Section 4 24
Angular JS Sticky Footer Problem (when page size doesn't meet minimum) 4 28
AJAX Wordpress Not Reading Variable 2 27
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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

856 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