Tuesday, April 5, 2016

How to align the button on the right in bootstrap?

This is something I always like to do, aligning to right or center.

With bootstrap, it's so much easier now.



<div class="row text-right">
    <div class="col-md-12 col-sm-12 col-xs-12">
        
        <asp:Button ID="btnAddNew" runat="server" 
CssClass="btn btn-success" 
            Text="Add New Member"></asp:Button>

    </div>
</div>

If you want to centerize the button, just change the class to text-center instead of text-right.

Formatting your code in Blogger post

I always write some codes in Blogger post, but since it's not supported, the codes are not shown.

I finally took some time to go and find how I can achieve this, and I think hilite.me does a good job.
It's simple to use and nice to see as well.



It's a simple page, but does a very good job.

Just copy and paste your code in the left section, choose your language and click "Hightlight!"
Then just copy the HTML codes in the right section and paste it in your Blogger post.

Just go to hilite.me

What is your favorite tool or way to format your codes in the blog posts?

How to add a vertical blank space in bootstrap?

I am now using bootstrap framework for my web design. It really helps me a lot in front-end design. There are so many useful components, but if I didn't know about them, it'd take me lots of time to trying to do it myself or digging for it. So, I think it's good for me to write down what I have learned and found useful, even though a very simple tiny thing.

I was just looking for how to do this: add a vertical blank space.

I usually just use <br/> or sometimes <p>&nsbp;</p>

I am sure there's a simpler and better way to do so. I searched for it, and I decided to use this:

<div class="help-block"></div>