Monday, September 11, 2006

Three Ways to Define your Font Size

I just tried these variations of defining font size, and this is the resume as far as I knew, I will edit this later if I had found other ways to define the font size. There are three ways (in my current knowledge) to define your font size, here are the ways:
1. Define the size by pixel measurement
Eg: body{
font-family: Verdana, Arial, sans-serif;
font-size : 11px; // Define the font size by pixel
}

2. Define the size by percentage measurement
Eg: body{
font-family: Verdana, Arial, sans-serif;
font-size : 70%; // Define the font size by percentage
}

3. Define the size by em measurement
Eg: body{
font-family: Verdana, Arial, sans-serif;
font-size : 2em; // Define the font size by em
}

From my experience, the first one is the most common one. I used the first one when I began to learn CSS. And now as my demand grows and my curiousity expand ;) hehehe I searched and found other ways to define the font size as I wanted to be. I found that the second and the third ways is the most adaptable to any browser *including IE*. It was presented *almost* the same in all browsers, unlike the first way. Ok then, feel free to explore and experiment ;)

Reading: W3: Starting with HTML + CSS