Solved

center wordpress theme

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 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 learn how to look for a specific file type in a local or remote server directory using PHP.

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now