Tuesday, November 29, 2011

Centering an inner div vertically inside another div

Green div is centered on a gray div
So how do you:
A div tagged as "divsmall" is contained inside a bigger div tagged as "divbig". the challenge is how to *vertically* align/center divsmall inside divbig.
Interesting question although having limited applications but still this should be possible. So, broke out my favorite IDE and started coding away. We start with our HTML.

 <!DOCTYPE html>  
 <html>  
   <head>  
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
     <link rel="stylesheet" type="text/css" href="css/mystyle.css"/>  
     <title></title>  
   </head>  
   <body>  
     <div class="div-big">  
       <div class="div-small">  
         <strong>div-small</strong>  
       </div>  
     </div>  
   </body>  
 </html>  
This should be easy to read. We then move to the CSS.

.div-big{
    background: #999;
    border: 1px solid #000;
    min-height: 640px;
    margin: auto;
    text-align: center;
    width: 940px;
}

.div-small{
    background: #66cc00;
    border: 1px solid #666;
    min-height: 600px;
    margin: 20px auto;
    width: 25%;
}
The trick in the margins. If you look at line 14, that all you need to center inner div. The width doesn't really matter. Try modifying the width value at line 15. The div should adjust in relation to its parent div.

Monday, November 28, 2011

All I want for Christmas is a XiaoMi

You simply can't knock it. This new Android phone from Meizu is off the hook! Spec-wise its gorgeous for only $310 bucks. That's about P13,500 in my pesos.

You will admit that it looks like an iPhone and that's what exactly its makers want it. The iPhone 4s is just weak if you do a side-by-side comparison.

The iPhone runs on a A5 dual core clocked at 800MHz. The Xiaomi run a Cortex-A8 dual core at 1.5Ghz. Xiaomi 1, iPhone 0.

Internal RAM? iPhone 500MB; Xiaomi 1GB. Xiaomi 2, iPhone 0.

The iPhone has a capacitive 3.5inch touch screen while the Xiaomi has 4inches. Xiaomi 3, iPhone 0.

The Xiaomi has this massive 1930mAh battery. I forgot what iPhone has on it but I will bet it running a standard 1430 mAh. Xiaomi 4, iPhone 0.

And please don't make get started on the price. We all already know that the iPhone is like 29k. How can you beat 13.5k phone with better or equivalent hardware?

Heck, the manufacturer is also promising that by January, Ice Cream Sandwich build will be available. FTW!

So for Christmas, unless your a fanboy, skip the iPhone.

For a more in-depth review, read this.

Anyone want to buy a Cherry Mobile MagnumHD?

Thursday, November 17, 2011

CM Magnum HD + MIUI = iDroid

MIUI Home screen
I bought my Cherry Mobile Magnum HD about about a year ago and if you have been following this blog, you'll remember that I installed and been using the Welcomm ROM. The Welcomm ROM has served me well but time to look for another.

Enter the MIUI.

Now MIUI is a custom Android ROM. The most striking feature is its UI. Its very reminiscent of a iPhone's user interface. That's why I sometimes confuse people when I tell them that I have an iDroid. *big grin*

Now, you will notice that in the official MIUI webpage that the Cherry Mobile Magnum (or its variants) are not support. That's because it isn't. I'm using a modified MIUI ROM by an Indonesian guy named TJ_Style. He hangs around the andro-id.net website.

To get your grubby hands on the rom, you'll have to register to the andro-id.net forum. Just run the site thru a translator since most of the post is in Indonesian.

Also, you'll need to get that custom CWM recovery for your phone so you can install the ROM and get superuser rights. That shouldn't to hard.

Anyway, here's a couple more screenshots of my newly flashed Cherry Mobile Magnum: