Tuesday, September 12, 2017

Ky thuat thiet lap co chu hien thi giong nhau tren tat ca trinh duyet

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:

Example

body {
    font-size: 100%;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 1.875em;
}

p {
    font-size: 0.875em;
}
Our code now works great! It shows the same text size in all browsers, and allows all browsers to zoom or resize the text!

No comments:

Post a Comment