Saturday, 10 January 2015

How to Centre Anything in CSS



I can't profess to know much about coding. I don't know much about anything in blog design, but while playing around, there are a few simple CSS codes I've learnt that I'd like to share with you!
 
Log in to your Blogger blog, go to Template > Customize > Advanced > Add CSS

Header Image:
#header-inner img {margin: 0 auto;}

Header Title And Descprition (text):
#header-inner {text-align: center;}

 Pages:
.PageList {text-align:center !important;}
.PageList li {display:inline !important; float:none !important;}

Post Titles:
.post-title {text-align:center;}

Post Dates:
.date-header {text-align:center;}

Sidebars:
.main-inner .column-left-inner, .main-inner .column-right-inner {text-align: center;}

Gadget Titles:
.section-columns h2, #sidebar-right-1 h2, #sidebar-left-1 {text-align: center;}

I really hope this helps you with any centring coding problems you might have. Yes it's basic, but it's effective. You can change the whole look of your blog, just by centring things!
On another, thank you to everyone who answer my survey, if you haven't done it yet, click HERE do to so! I look forward to your answers.
 -Kat

13 comments :

  1. I used that to centre the header, post titles and tabs on my blog.
    Love your new design!

    -BB xoxo

    ReplyDelete
    Replies
    1. I'm glad it helped. I'm off to go and see!

      Delete
  2. Merci!!!! Now I can center my post titles!!

    ReplyDelete
    Replies
    1. Hahaha! It's useful, isn't it?

      Delete
  3. Centering post titles and dates is a really good idea in blog design, and it can definitely make the post title a little clearer and more significant. Perhaps another idea is if the post title is centered, then it's also recommended for the rest of the sidebar headings and gadget titles to be centred as well, so the blog design looks more complete and consistent. You're right, centering headings can change the look of the blog significantly. :)

    Dian
    The Happy Candle

    ReplyDelete
    Replies
    1. You're right! I thought about just posting one of the codes, but then I realised that to make the look right you need everything:)

      Delete
  4. Wow, this is really insightful, and I really want to use these tips on my own blog. Thanks for posting this! :)
    -Lauren <3
    lovingourcreator.blogspot.com

    ReplyDelete
  5. I do agree that centering often makens a design look cleaner. When I design, I sometimes use the Simple Template and man, it's really messy! But I do think that blogs can look nicer without having to center some things, but you have to play around with the CSS and see what works best. ^.^

    xoxo Morning

    ReplyDelete
    Replies
    1. Yes! I find that blog designing is all about testing and seeing what looks right for this blog. Because every design is different!

      Delete
  6. Now my blog will be centered. OM.

    ReplyDelete
  7. "Australia has one of the highest rates of skin cancer in the world," cheap timberland boots advocacy director Paul Grogan said in a statement to AFP. "Solariums expose users to extremely highly levels of UV (ultraviolet) radiation, greatly increasing their risk of melanoma timberland outlet uk and other skin cancers." Australia is sometimes referred to as the sunburnt country, where beaches are thronged with bathers basking under blue skies and the rates of melanoma, timberland outlet sale a potentially fatal form of skin cancer, are the highest in the world.

    ReplyDelete

If posts are the brain of a blog...then comments are it's heart - Neal Kind