Doing a 100% scalable website is possible. As Rev said, you can do this by using percentage values, but it is tricky.
The better option is to utilize @media queries
. These allow you to apply CSS rules to a page only under certain conditions. By using media queries to detect the device width and/or the page width, you can apply fine tune control over how your site looks AT different viewport sizes. For instance:
@media screen and (max-device-width: 960px) {
font-size:14px;
}
@media screen and (max-device-width: 480px) {
font-size:13px;
}
Now, the above example is rather trivial and contrived. For a deeper understanding of what you can accomplish with media queries, I recommend you view the W3C spec page. Some of the most powerful are the width
, min-device-width
, max-device-width
, portrait|landscape
, and print
queries.
As a side note, make sure to include these styles at the bottom of your CSS, so that they dont get overwritten by default styles.