Before reading this post I recommend reading the previous posts in this series:
Customizing Your Blog – Part 1 Gathering Patterns and Colors
Customizing Your Blog – Part 2 HTML Code
Customizing Your Blog – Part 3 Fonts
Customizing Your Blog – Part 4 Creating a New Header
THE BASICS
As always, try these changes on your “practice” blog first until you figure out what you want and how to do it.
To change the width of your posts and sidebar columns first open the Edit HTML under the Layout section of your blog’s dashboard. Scroll down the template until you get to something similar to this: (some templates like Rounders say Page Structure instead of the first Outer-Wrapper and say Main-Wrap instead of Main-wrapper)
/* Outer-Wrapper
———————————————– */
#outer-wrapper {
width: 660px;
margin:0 auto;
padding:10px;
text-align:$startSide;
font: $bodyfont;
}
#main-wrapper {
width: 410px;
float: $startSide;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
#sidebar-wrapper {
width: 220px;
float: $endSide;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
See where it says width under each section? That’s the width in pixels of your columns. The outer-wrapper is the width of your blog. The main-wrapper is the post column and the side wrapper is the sidebar. Some blog template don’t have pixels as their width. Instead there’s no width under the outer-wrapper and the width in the main-wrapper and side-wrapper are percents like
width: 68%;
These can be changed to pixels but first you have to add a pixel width under the outer-wrapper section in your blog template. Just use the one above as an example of what to type.
On average the width of a blog is 750 pixels. You can increase that but if you get too big your readers will end up having to scroll sideways to see everything and that gets rather annoying. To avoid that don’t get any wider than 980 pixels (px).
The main-wrapper and side-wrapper widths should add up to less than the width of the outer-wrapper. If they add up to more than the sidebar gets bumped to the bottom of the page after all the posts. If they add up exactly to the width of the outer-wrapper then there’s no padding around the words and they all blend in together making for one crazy looking mess.
FUN STUFF (MORE ADVANCED)
Changing Sidebars from Right to Left
Changing your side-bar from the left side of your blog to the right side or vice versa is as simple as typing in left or right. Erase the blue below and type in right (or left) making sure you don’t type right (or left) for both the main-wrapper and side-wrapper.
#main-wrapper {
width: 410px;
float: $startSide;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
#sidebar-wrapper {
width: 220px;
float: $endSide;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
Moving the alignment of the columns
Some blogs have the text of their main post starting right at the edge of their blog. Others have a “buffer” and their posts start say an inch or two from the side of their blog. This is what is called the margin. If your template doesn’t have margin listed under the main or side wrappers you can add it in. It should look like this:
margin: 100px;
The number of pixels isn’t the only variable that you can change. The example above is telling the computer you want a margin of 100px all around the entire column. If you just want the margin or “buffer” to be on a particular side you have to tell the computer that. For example,
margin-left
margin-right
margin-top
margin-bottom
Keep in mind that your blog is only so many pixels wide.The margin widths also need to be added to the sidebar and main post widths to make sure they come in at exactly the outer-wrapper width or less.
Background for Main Posts and Sidebars
I received a question on how to make the background for the main post and sidebar the same. The answer is actually simple and hard, or rather time consuming. The background image for the entire blog is used to create the look of the main post and sidebar sections. The ‘borders’ you see are the result of the background image.
I created the background image using my Photoshop Elements program. Any photo editing program will allow you to create a background. The hard part comes in guessing how far from the edge of your background to put your border for the main post and sidebar. Then use the instructions here for inserting the background you’ve created into your blog template.
After inserting your background you need to add the following red code under the body section of your template.
body {
background-position: center;
background-attachment: fixed;
margin:0;
The background position can be moved to either the left or right side if you wish. Having it centered though makes it easier to work with. The background attachment is fixed meaning the the blog background will not scroll when the main posts and sidebar do. It stays static on the screen.
You can then adjust the margins of your main posts and sidebar using the instructions above. You also have to delete the backgrounds for your main-wrapper (main posts) and side-wrapper (sidebar) so the blog background can be seen creating the illusion of one continuous border for both.
Any other questions? Please feel free to ask!
Richelle says
Thanks! I’m going to have to try that.
Calandria says
Oh, good! I can’t wait to try this when I have a few minutes. Your tutorials are excellent.
Skye Lee says
Is it just me? Why can’t I read anything on the left side of the page? It is covered by the dark brown. I am really interested in this post too 🙁
Princess of Everything (and then some) says
You are my hero!! I just stumbled across your blog while trying to update my template. I followed your WONDERFUL instruction and BAM I have a snazzy new blog!
Going to work on the header now!!
I owe you big time!!
Cocoa says
skye lee,
I haven’t had any other complaints about it. Is your screen resolution set too low? Sometimes that will affect how everything, especially web pages and blogs, look on your screen.
Tamra says
i find it a little difficult to read the post too at least the part that is over the dark brown ribbon. Anyway, i love your tutorials. I’ve used them to jazz up my and my mom’s blogs. I was wondering if you are going to show us how to keep the background still and just the posts and sidebars scroll? I love the way that looks. Thanks so much for these tutes. And congrats on winning that spectacular necklace from DesignMom.
Tamra says
oops, just re-read the last one of your instructions. Thanks. =)
The Gooch Family says
These are great, Cocoa. Are you going to teach us how to put those great buttons and widgets on our side bars now. I’d like to know how you got the one for the Church.
Ritsumei says
These tutorials are lovely! I just fixed up my blog too. It’s fun to have a more customized look than what comes in the Blogger templates. Thanks so much for all the time that goes into this!
Here’s my burning question: I’ve got an image that I’d like to add between my posts, like I’m guessing that you’ve done with your “Cocoa” at the end of your posts, but I’m where yours is a signature & works as a picture, I want a cute little bar thing that comes with my linkware webset that I’m using. Do you know how to do that? Does that question make sense??
Ritsumei says
One more burning question: could you also show us how you did the buttons at the top? “home” “flannel board stories” ect. Thanks!
kelly rae says
this is so helpful. may i ask if there is away to have 2 sidebars (one on the left and one on the right). would you be willing to perhaps do a trade? some art for helping me with my dear old blog?
let me know!
i’m at http://www.kellyraeroberts.com