Each post in the separate box - Blogger XML

November 19, 2008

In this tutorial, we're going to divide (separate) our posts in boxes (frames), so each post will have it's own "house", and you'll be able to see background between them. See below what I'm blabing about:

You can see the live preview here and here (the one with separate boxes).

If you to do the same thing for sidebar gadgets, read this article: Sidebar gadgets (widgets) in separate boxes

Ok. You should keep in mind:

► this is the example for the Blogs that already have a customized (stylized) Post area
► this example was made in Minima Blogger template (so your code may be a bit different, but the procedure is the same)
► it doesn't matter if you have "heavily" customized template, you can apply these setting anyway

UNDERSTAND THIS
....main-wrapper defines the Post area in Blogger Template. The whole idea here is to copy the style of main-wrapper, and to apply it to elements inside of it.

....now, the whole section of "main-wrapper" looks like this (in my example):
#main-wrapper {
background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;
padding-left:7px;
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 */
}
...the part in white is default, and I've customized template a bit with part in orange.

...I've also added some padding so the text is not too close to the edge. Read more about adding borders in Blogger here.
...your style will be different, of course. But this doesn't really matter .

So, you want to keep the same style (design) and separate posts into individual boxes. Here's:

HOW TO DO IT
First thing you should do is back up your current Blogger template. Then go to:
DASHBOARD ► LAYOUT ► EDIT HTML, and in the code section, find the following line of code:
#main-wrapper {
...in my example the whole section looks like this:
#main-wrapper {
background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;
padding-left:7px;
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 */
}
...now, I'm going to copy the style (in orange) and paste it in my main-wrapper elements (find the following lines in code):
h2.date-header {
margin:1.5em 0 .5em;
}

.post {
margin:.5em 0 1.5em;
border-bottom:0px dotted $bordercolor;
padding-bottom:1.5em;
}
....after pasting the code, it should look like this:
h2.date-header {
margin:1.5em 0 .5em;
background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;

padding-left:7px;

}

.post {
margin:.5em 0 1.5em;
border-bottom:0px dotted $bordercolor;
padding-bottom:1.5em;
background:#FFDEAD;
border: 1px solid #E9967A;

padding-right:7px;

padding-left:7px;

}
....you can see the added code in orange.

Next thing is to hide (or delete) the copied style from "main-wrapper". If I don't do this, my template will look like this:

....to avoid it, I'll hide the style in "main-wrapper" using /* and */....in the code it's like this:
#main-wrapper {
/*background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;
padding-left:7px;*/
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 */
}
...alternately, you can just DELETE the style from the main-wrapper...
...now, the style for main-wrapper is disabled, and you can see a gap (a Blog background, in fact) between your posts...

FIX
To align your sidebar with the post section, find this part of code:
h2.date-header {
margin:1.5em 0 .5em;
..and change it to:
h2.date-header {
margin:0 0 .5em;
Save Template.

ADVICE
► In this example, the date has it's own box. Hm. You can change this if you don't like it. Read the instructions on:
How to move the date under the post title in Blogger

► If you have switched to Embedded comments below posts, you should consider customize them a little bit......Why? Because your Blog background may come in the way, causing low visibility of the comments and comment form....It depends on your background color. You'll get it.....

Well, that's about it....improvise, try, play, organize, design.....and

Smile!



post signature
Face It! Tell Your Tweets Digg It! Add to Delicious Stumble Upon I Reddit! Mixx it Up! Add to Your Faves

86 comments:

LaaLaa said...

been looking to do this in the XML codes for ages thanks alot :]

pocket said...

Glad you've found it then...
Smile!

LaaLaa said...

btw is it possible to have this code in the sidebar section. I've been playing with the code
but I just can't get it right.

pocket said...

Piece of chocolate.
LAYOUT -- EDIT HTML, and find the following code:

.sidebar .widget, .main .widget {
border-bottom: 2px solid #f26522;
margin:0 0 1.5em;
padding:0 0 1.5em;
}

...you have to DELETE it, and replace with following:

.sidebar .widget {
background-color:#161616;
padding: 1px;
border-bottom: 2px solid #f26522;
margin:0 0 1.5em;
padding:0 0 1.5em;
}

.main .widget {
border-bottom: 2px solid #f26522;
margin:0 0 1.5em;
padding:0 0 1.5em;
}

...then find your "sidebar-wrapper", and delete some lines, so that it finally looks like this:

#sidebar-wrapper {
width: 230px;
float: right;
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 */
}

...that's it. You have really nice website there...

Smile!

LaaLaa said...

A* thank you soo much :]
one small problem not with your code but
on my sidebar I can't get it level with my posts.

-btw I will add you to my blog roll :]

pocket said...

Find this part:

#sidebar-wrapper {

...and add some margin under it:

#sidebar-wrapper {
margin-top:-10px;

...change the value -10px, to adjust it more smoothly...(more negative - goes more up)

Thanks for support.

Smile!

moih60 said...

wonderful work man .. but there are some blog i cant find the #main-wrapper { part

wat can i do??

pocket said...

I've mentioned that main-wrapper is just for my example (and for the most of Blogger defaulr templates)...
Now, it depends of your template....but it's there. Under a different name...Try to figure it out. If you can't, email me the Link of the Blog, and I'll check it for you...
Smile!

Radith Prawira said...

Hi there.. ^^ i'm trying to do that trick into my sidebar but unfortunately there are some widgets that get the border right while others don't. the url of my dummy blog : http://asasasasafvfvfvfv.blogspot.com/

Thank you :)

pocket said...

Hey..Site looks great!
Seems like the followers gadget is giving you troubles. For starters, I suggest adding borders to your sidebar widget style too...Find:

.sidebar .widget {
border-bottom: 3px solid #F2F2F2;
margin: 0 0 20px 0;
padding: 0;
}

..and change to:

.sidebar .widget {
border-bottom: 3px solid #F2F2F2;
border-left: 3px solid #F2F2F2;
border-right: 3px solid #F2F2F2;
margin: 0 0 20px 0;
padding: 0;
}

If this is not working, we'll need to take care about followers style. Specifically.
Other gadgets are all right? Something I've missed?

pocket

Radith Prawira said...

wow..tq very much man for the quick reply! i'm surprised and honoured that you followed my blog.. eventhough it's just a 'test-blog' silly me, without no design and no coding skill trying to modify blogger template, hahhaha.. it's very tiring job and i admired those who can make a great templates especially when they released it for free ( that means you ^^ )

---

that trick do the magic, but unfortunately there's a slight misline in the left-border i some widgets. i moved my follower widget and added feedjit and same problems appears.

one thing i noticed is that when i sign out from my blogger acc the problem didn't showed up.

pocket said...

Hm. Than you'll have to blame quickedit icons for this. The good news is, it will only look like that for your eyes. I've just visited the site, and it's fine...
Never hesitate to ask.
And you're too modest...Your Blog is fantastic! Honestly. And you're still building it. It will be a pearl, for sure...
:]

Radith Prawira said...

Glad to hear that. I've been strugling to add some style into the sidebar for almost a week! :( ignoring my own blog(s) i'm too naive for having too many blog that i can't handle, hehehe

Oh no..i'm being honest here. i'm just implemented other peoples trick to get my blog done. :)

Btt, my next target is to add some stlye to the footer section, but i don't know where to put background ( if in the sidebar there is #sidebar-wrapper ) i can't find #footer-wrapper

Thank you
Warm regards from Indonesia, Radith ^_^

--

p.s i did a lot typo in my comment above so i decided to delete it ( can't just edit it instead ) but i'm dead sure that i'm also doing a lot of misgrammar.. hehehe.. stupid me

pocket said...

Scroll down a little further, and you'll find:
#footer {
clear:both;
margin:0 auto;
padding-top:15px;
line-height: 1.6em;
text-transform:uppercase;
letter-spacing:.1em;
text-align: center;
}

One more thing. Let's continue the conversation on email...I can be more descriptive that way.
And don't worry about the language...I'm not English-fluent too....
Smile!

Radith Prawira said...

Email sent :)

Your english is very good dude, unlike mine, >_<

Success!
Radith ^^

Anonymous said...

Many thanks for you crystal clear tutorials. They make template modifications a breeze.

Just keep it up and you are sure to get to heaven. :-)

insolemn

pRaWnoADie said...

i cannot seem to do it..!! i just dont know how to edit my template HTML. i really want to hv each post in separate box. can u please help me..? my blog: singlers.blogspot.com

pocket said...

pRaWnoADie,

you have already customized template. It's hard to say. These templates already have certain style, and if you want to change something, you have to know how it's constructed. If this was mine temp, I would do it for you, but can't mess with this one...
Sorry.

pRaWnoADie said...

i see..but how about this, i found that what i want to repeat is the 'side central'.this is the codes:
/* Side Central +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */

.SC { width:526px; padding:0; margin:0; float:left; background:#e4edc3 url(http://i40.tinypic.com/jv3mn8.gif) no-repeat top left;}

do u hv any idea how to change the no-repeat top left, to make it repeats in each post? im still trying though..huhu..tq for ur attention n help.

pocket said...

The best thing would be to contact the author of the template. In this case, Falconhive.com.

Christine said...

This is so awesome!! I got it to work perfectly with my blog. I'm bookmarking your site and using it always. Thanks so much.

pocket said...

Christine,

I'm glad you liked it! Thanks for support...
:]

lillian said...

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

Ann

http://externallaptop.net

B34TZ said...

Hey I tried to do what you said, but I can't seem to find the part that I need to copy. This is what I can see:

#main-wrapper {
display: inline; /* fixes a strange ie margin bug */
float: $startSide;
margin-top: 0;
margin-$endSide: 0;
margin-bottom: 0;
margin-$startSide: 3px;
padding: 0;
width: 483px;
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 */
}

#main {
padding-top: 22px;
padding-$endSide: 8px;
padding-bottom: 0;
padding-$startSide: 8px;
background: url(http://www.blogblog.com/thisaway_blue/bg_content.gif) repeat-x $startSide top;
}

Can you help me in anyway? Have a look at my blog if that helps..

www.2Emptyminded.blogspot.com

Thanks!

pocket said...

B34TZ,

...this won't be so easy to explain. Even if I do try, I can't guarantee that it will look nice...Sorry.
The problem is that you're using quite customized template already, and you'll have to remove default background pics first. Than adjust the other settings....

You can try switching to Minima template, which is ideal for any customization.
If you decide to do this, back up your widgets (links, pics..), and other stuff....

Rafay Baloch said...

Can u plx teme HOw to add the option"read more" to shorten your posr

Radith Prawira said...

@Rafay baloch

have you read pocket's post on http://www.blogbulk.com/2008/11/read-more-or-expandable-post-summaries.html

Sarathganesh said...

hey pocket
I increased my blog's width and did lot of changes.Now when i want to rearrange the page elements I can only see the top half of the page.so please tell me what's the problem??

Sarathganesh said...

Oh yeah just tell me if it's all right if i use some of your images like the codeview.I also used your ideas in the related posts category of my posts[from 'howto'(css)]
it can be seen here, see below the post ok!

http://boltions.blogspot.com/2008/12/how-to-change-blogger-template-without.html

and also tell me how does my template look?
i want a true opinion from you with suggestions please!

JocyLikesTofu said...

Hi Pocket!

You have a really cool website here...nice design!

I need some help: Hi Pocket!

You have a really cool website here...nice design!

I need some help: http://www.blogger.com/html?blogID=692902333937249528

Ever since I upgraded my template by accident, modifying for me isn't easy for some reason.....

Is it possible for me to separate and change the colour of the background of the widget (at the top of the blog posts) from the blog posts?

I'd really appreciate your help. :)



Is it possible for me to separate and change the colour of the background of the widget (at the top of the blog posts) from the blog posts?

I'd really appreciate your help. :)

JocyLikesTofu said...

http://jocylikestofu.blogspot.com/
Sorry this is the link to my blog :)

...love Maegan said...

you are my hero ;)

Phase Fidel said...

Hi,

First off great site. I check here often.

Now I am having a problem with this hack. I can get the first part of this done, but when I get to this step I run into a problem:


h2.date-header {
margin:1.5em 0 .5em;
background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;
padding-left:7px;
}

.post {
margin:.5em 0 1.5em;
border-bottom:0px dotted $bordercolor;
padding-bottom:1.5em;
background:#FFDEAD;
border: 1px solid #E9967A;
padding-right:7px;
padding-left:7px;
}

I add the code and only change the colors to my blog colors, but after I wrap the first part with /* and click preview, my blog looks like it orginally did. The posts are not seperated, and there is no border at all.

I have a feeling I am either doing this wrong, or maybe some other code is preventing this from working. Could you please help me with this?

PhaseFidel.com

Anonymous said...

There are great tips here. They have helped me alot. Thank you very much. Would you be able to teach me how to make rounded corners for each post?

germi said...

thank you pocket, I really love this blog. (my english it´s too bad, sorry) Regards from argentina;)

Katrien said...

Hi, thanks a lot for all this usefull stuff!
I've got a little problem with my sidebar, I can't get a full line around it, it's only underneath it.. Can you help me? Thanks!

Linn said...

Thank you, so much for this amazing blog! Really, what a great thing to do. It has helped me so much :) I would also love to make round corners on the boxes around my post... Can you help? Thanx :)

Ms Hetal Patil said...

I have just now shifted my post footer elements below post title. I tried tips from this article and i am getting border around date, post title and footer elements and not around the whole post.

Can you help me?

http://shirdisaibababhajan.blogspot.com/

Eli From Brooklyn said...

I don't have a separation between my blog post's main section and the sidebar. Do I have to start there? Do I need to make a padding? Ah, please help. I have a minima too so I'm sure I can't be way too off...

EliFromBrooklyn.Blogspot.com

Thanks so much and you should just know, you do great work.

Thanks.

juse said...

How do we put the date and post closer together?

I want it so that my pink and purple boxes have no white space in between.

jusebox.blogspot.com


Thanks! :D

10K Wedding Day said...

hi,
great site! I am having the same problem as juse I think. I noticed that when I tried your method, a space is created between the post date, and the body of that day's post. how can I remove that completely?

Nell Bell said...

thank u so much!

t4-trix said...

good post,how do u get so many comments

Stefany Loren said...

thks again!!!!

Ed said...

what is the 'padding' for?

Kittynail said...

I can't get the post box and sidebar aligned. How to fix it?

Statistics to Share said...

Do you think the spaces between posts would increase the loading time?

Lisa said...

hi,

It has been my fourth attempt trying to add this to my html but my page never seems to seperate and my page looks see through into the background?

my blog posting is looking to long now and I would just like to seperate the botton of my listings away from my top but it doesnt seem to work anyhow?

i have had no problems doing my side colums but I am having difficulty doing the main column, why is this?

http://bebedomakeupandlife.blogspot.com/

Please could you give me some advie on what i should do.

thank you very much in advance.

pocket said...

Kittynail,

read tge "FIX" part of tutorial. That should align them..

Lisa,

I really don't know what's wrong. If you have a customized template (heavily customized) maybe this can be the problem....

sera said...

thank you very-very much for creating this tutorial. you really help us dummies about blog html :D

Anonymous said...

very usefull!!! Thanks a lot

Watered Soul said...

Appreciate all the helpful tips. I'm a blogger novice but would love to seperate my posts. However, I can't find the main wrapper. I see a main-wrap1 and a main-wrap2.

pocket said...

Watered soul,

for your current template, here's the code of the post section that you'll have to tweak:

#main-wrapper {
width: 460px;
float: right;
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 */
}

But, doing this with already customized templates can be a tough job sometimes....

Good luck!

Smile!

Allison said...

This worked great, BUT, the border at the bottom of each post is coming out white instead of the pinkish color. How do I fix this?

Michelle said...

Hi, I have a problem with my post footer, why my post footer links don't appear on my post? Only email this post link, why is that? Please help!

Becky* said...

Hello, hello, hello! I'm making a blog template for a friend and I just tried this... But! (Yeah, there's always a "But"...)
The *side*bar is coming out UNDERNEATH all the posts... So it's now a, like... Under Bar. Ha. Yeah I'm not funny. :)
But yeah can you help??

If you don't get what I mean (which you probably do...but just incase-) my blog is www.becky15077.blogspot.com

Thankssss!! :D
Becky*

Anshul Pandey said...

Mine is Minima stretch....and the whole section looks like this

#main-wrapper {
margin-$startSide: 2%;
width: 67%;
float: $startSide;
display: inline; /* fix for doubling margin in IE */
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 */
}

How do i do it?
:(

Varun said...

Hey there nice hack!!
but...it doesn't work in mine i didn't even have
the #main-wrapper { in my blog pls check it
:(
www.beepthegeek.net

pocket said...

Varun,

you have a customized 3rd party template. Your main-wrapper is:

#colLeft{

Smile!

lee said...

i don't have a #main-wrapper in my code where can you find it?

Bernice said...

Hi there...

How I remove the space in between the post and date header while keeping the posts separated from one another?

MMA BlogTeam said...

Hi. My website is MMAStreamingCage.Com (Changed my Domain, used to be a Blogspot)...I cannot Find the #Main-Wrapper Code to Replace in my HTML...Pocket, I'd appreciate it you could go to my site and Find it in the Page Source...Suggestions for my Site would be helpful too.

Also for my site: http://watchsimpsonsfreeonline.blogspot.com

How do I stretch the Header Picture (Simpsons in Filmroll) across the Screen? One end to the other end...It'll look better that way but I'm not sure How I could do that. Any help would be greatly appreciated. My Email is mmablogteam@gmail.com or you can just Reply Here.

Thanks so Much!

FiqaSaleh said...

i got problem with a new blogspot design which is i cant find the code u give ..

ClaireyH said...

I am new to this stuff, so sorry if it shouldn't be this hard, but I can't even find the text "mainwrapper" in my html.

this is the site - claireyhewitt@blogspot.com - I think it is a pretty basic template (certainly nothing fancy about it yet, will have to grab one of yours I think.)

Has the mainwrapper text changed in the new blogger templates?

Syaidatul Amira Omar said...

thank you so much. it's really help

eman said...

dear pocket,
i don't find the main-wrapper code..
i realy want to divide each of my post in a different 'house' ...
i used blogspot..
so, mybe it has a different code for that?

-beginner-

Adeyna said...

why i can't change the color of the wrapper ? i want to change it to #FFFFFF but it wasn't change . it still be the same . please help !

Daniel Battersby said...

I seem to be in the same boat as some other people here. I cannot find the #main-wrapper coding. I think it is because I don't have it because I am using the Travel template and not the Minima. You wouldn't happen to know how to make this hack work in the Travel template would you?

Thanks

onmyradar@gmail.com (if that is easier to get in touch for you)

onmyradarblog.blogspot.com

希敏 said...

Hi!! I just want to ask how did you make a box in a posts?? Like the gridlines and scissors box you put it in the posts. How did you do it??

CuisineHOUzz said...

Hai Thank you very much for this nice work with very clear info.please look my blog,I have problem with my date header box and also with sidebar seperation codes.Plz help me to solve it?

Anees said...

thanks for this article buddy! i have this things already in my blog. http://www.learneveryone.com but the problem is that when i publish 2 posts in a same day, it does not show the gap :( i want fix this! can you help?

Finding God's Divine Purpose said...

Im having a very hard time.n Im such a blogger dummy forgive me lol but I'm having trouble finding any of these codes.
Can you please help me out I've went to edit html and my eyes are burning from searching lol my blog is
www.livingwithdivinepurpose.com

I find your site very helpful thank you soo much
~smile~

Jennifer said...

I have a few questions! =)

I have the ethereal template in blogger and would love to separate the sidebar from the post column but would like it to float over my image background instead of a solid color like the template you pictured in these examples.

here is what the blog looks like: Peas & Crayons

do you think you could offer any tips/codes/advice? Is what I want to do with the page possible?

Thank you so so so much!

xoXOxo
Jenn @ Peas & Crayons

email = PEAS and CRAYONS at gmail dot com

Jennifer said...

In case I sound like a crazy person -- how your page is set up -- with the separate post column and side bar column over your textured background -- that was what i've been trying to accomplish for. ev. er.

haha thanks so much!

xoXOxo
Jenn

RoK the Reaper said...

I cannot find the #main-wrapper and I am trying to get a box around each post, respectively.

http://www.RoKtheReaper.com is my blog

RoK the Reaper said...

Oh, RoKthereaper@RoKtheReaper.com is my e-mail.

Becky said...

Great site! I'm having real difficulty finding the #main-wrapper { in my Edit Html section - if you have a second could you check it out and see if it's possible?

www.liberatecreativity.com

Also, I want to be able to automatically place a large thumbnail photo (Flush left) of each truncated post....do you know how to set this up by chance? Thanks!

κύριος Καρπούζης said...

Hi thanks for this great post. Great work on your blog BTW its very nice and simple. I am trying to fix my blog, by doing separate boxes on posts and on the widgets but i have some problems.

1. I changed the template somewhat following your detailed work here, but my boxes kinda overlap (the main post box with the widget area) they are not adjacent or with a bit of a gap like for instance in this website.Do u know how i could fix that?

2. i want to use a blurred background image on top of my regular image so that they match perfectly

3. i would like to make the corners of the boxes more round.

You think you could help me with any of these?

this is the link to the blog kkarpoyzhs.blogspot.com

Thank you, and sorry if i am asking too much, if you cant help me, please if you would be so kind as to redirect me towards someone that could!

Kristen {RAGE against the MINIVAN} said...

Love this - worked like a charm. Thank you!!

Eventually said...

hi, can you help me with my problem? I want to separate my posts into boxes but the main-wrapper is no where to be found in my code.

From reading the comments, you suggested to look for something similar, but i really don't have a clue what to look for. The site is www.eventuallyco.com.

Thanks!

sangram said...

hi, i do have same problem which is said above.iwant to separate post into boxes but the main wrapper is no more.....???? my template design is "AWESOME INC".PLS HELP ME..

browse free with your phone said...

thanks for this code

nigeria newspaper online said...

thanks for this code, you can how beautiful my blogs are!!!
Nigeria Entertainment Online
and
etisalat downloading cheat

OkamiS said...

How do I remove the border once I go to Post page?
DEMO blog : http://kaminime.blogspot.com/

Abdur Rakib said...

I find #main-wrapper { no where.

Visit here for some blogging help

Unknown said...

me tooo .. no main wrapper what should i do... please help

Say it...

Related Posts with Thumbnails