As I have mentioned, padding determines the space surrounding the content of an element. To explain what I mean by this, here are two examples of a table cell, the first has no padding defined while the second is padded by 10px on all sides:
| A table cell with no padding |
| A table cell with padding |
In blogs which feature borders around it's element, or differing background colours, defining the padding of each elements may be crucial in achieving a user friendly template design.
The padding definition for a particular blog element can be defined in the style section of your blog. Here is an example from my template which defines the padding used for the main posts section:
#main-wrapper {The line highlighted in red defines the padding in pixels for all four sides of this element in a clockwise direction beginning with the top:
margin-left: 14px;
width: 430px;
float: left;
border-left: 1px solid $borderColor;
border-right: 1px solid $borderColor;
background-color: $mainBgColor;
padding: 0 10px 0 10px;
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 */
}
- Top-side: 0
- Right side: 10px
- Bottom side: 0
- Left side: 10px
This ensures that the text (or any images) within the main posts section is distanced from the borders on either side.
Using this method, you can define padding for up to four different sides of an element, as in the following example:
sidebar {padding: 10px 12px 10px 12px;}This defines 12 pixels of padding between the upper and lower borders of the sidebar and the sidebar content, and 10 pixels between the sides.
It is also possible to define equal padding for all sides of an element using a single statement, for example:
Sidebar {padding: 10px;}This would ensure there is 10pixels of padding on all sides of the sidebar element.
You can also define padding for each side individually, as in the following examples:
padding-top: 1opx;.
padding-right: 12px;
padding-bottom: 15px;
padding-left: 20px;
If you would like to experiment with values for padding, you can use the "Try it Editor" over at W3 Schools, which allows you to experiment with CSS styling for padding in the left window, and see the results in the right hand window.
If you prefer to experiment with your Blogger template, be sure to make a back-up of your template before saving any changes, in case you'd prefer to revert back to the way it looked before.
Related posts:
Technorati Tags: blogger | template | design | padding | css | style





Hello, your site has been very helpful in setting up my blog. I was wondering if you could take a look at my blog; I'm pretty new to CSS/HTML so I've been googling a lotta different things, but I can't figure out how to space out my columns.
ReplyDeleteThe left column has way too much space on the left, and the right column has way too little. I was hoping to have them be even, so all 3 columns would have equal space.
thanks.
thanks man
ReplyDeletekalosi.blogspot.com
thank u amanda very much
ReplyDeleteThank you for ALL of your wonderful tutorials...would you please take a look at www.SunshineFarmgirls.blogspot.com and give me some guidance on how I can get things more "centered", or evenly spaced? Thanks a million!
ReplyDeleteThanks for taking the time to discuss this, I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information
ReplyDeleteI like it thanks
ReplyDeletelocksmith
locksmiths
24 hour locksmith
new york locksmith
manhhatan locksmith
bronx locksmith
bronx locksmith
emergency locksmith
auto locksmith
A healthy diet is not about strict nutrition philosophies, staying extremely thin, or depriving yourself of foods you love. Rather it is to get that good to have more energy and you keep healthy as possible.
ReplyDeleteFor your nyc locksmith search, look no further than M&D Locks and Keys. They have 24 hour emergency service for residential, commercial and automotive and guarantee that theyll get to you within 15 minutes.
ReplyDeleteVery thorough article with some interesting points raised – not entirely my thing, but there you go.
ReplyDeleteI learned something today! Thanks! But I manage to include your blog among my reads every day because you have interesting,
ReplyDeleteThe positive comments and do well wishes are very motivational and greatly appreciated.
ReplyDeleteI really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
ReplyDeleteI wanted to write a quick note to express my thanks. I'm really impressed by a blog unique and
ReplyDeleteperfectly chosen and organized!
phone number lookup
ReplyDeleteWell,OK.I have to say,what a wonderful blog it is.thank you for your sharing so good articles in the website.I like it very much.
ReplyDeleteIt’s really a great post..I would like to appreciate your work and I am going to recommend it to my friends. Thanks for sharing.
ReplyDeleteWonderful post. I am searching awesome news and idea. What I have found from your site, it is actually highly content. You have spent long time for this post. It's a very useful and interesting site. Thanks!
ReplyDeleteI am happy when reading your blog with updated information! thanks alot and hope that you will post more
ReplyDeletesite that are related to this site.
Thanks to a brilliant effort in publishing your article. One can be more informative as this. There are many things I can know only after reading your wonderful article.
ReplyDeleteIntersting...!!! exactly what i was looking forbuy codeine online
ReplyDeleteGreat blog. All posts have something to learn. Your work is very good and
ReplyDeletei appreciate you and hopping for some more informative posts.
thank you……..
Natural supplements
organic supplements
Testosterone Booster Supplement
I was working and suddenly I visits your site frequently and recommended it to me to read also. The writing style is superior and the content is relevant. Thanks for the insight you provide the readers!
ReplyDeleteI agree with you. This post is truly inspiring. I like your post and everything
ReplyDeleteyou share with us is current and very informative, I want to bookmark the page
so I can return here from you that you have done a fantastic job ...
Natural supplements
organic supplements
Testosterone Booster Supplement
I'm still learning from you, but I'm trying to achieve my goals. I certainly enjoy reading all that is posted on your blog.Keep the information coming. I loved it!
ReplyDeletebuy curcumin
organic supplements | natural allergy relief | Natural Colon Cleanser | Natural Weight Loss
ReplyDeleteIt’s good to see this information in your post, i was looking the same but there was not any proper resource, thanks now i have the link which i was looking for my research.
ReplyDeleteI’m still not really certain how much I agree with you on it all. I subscribed to your rss feed though and will certainly keep following your writing and possibly down the road I may chime in once again in much more detail.
ReplyDeletenatural suppliments
Curcumin is one of a small number of super nutrients which has the demonstrated ability to dramatically lower the risk from cancer, heart disease and many other diseases.
ReplyDeleteThanks to share with us the information. I wish you good luck!
ReplyDeletesbo
ReplyDeletethnx for nice work
and pretty simple example but
where can i see the form i m not able to see the dorm created by module??livescore