How does CSS work?

404 viewsOtherTechnology

I’m a programmer by trade. I use CSS just about every day, but I’d be lying if I said I understood how it works under the hood. What exactly does CSS do behind the scenes when I pass the parameters? How does browser support play a role in all of it?

In: Technology

4 Answers

Anonymous 0 Comments

Instead of designing a website by saying “here’s the background, it’s green” and “here’s a headline, it’s 20pt Helvetica Bold, centered to the page” and “here’s the body text, 12pt Helvetica” you just design a web page to have parts labeled background and headline and text, and the stylesheet is where you put the attributes, so everything called “headline” looks the same and all the backgrounds look the same etc.

This way, if you want to change how a site looks, you can adjust the style sheet instead of fixing every page individually, which is tough, because with something like PHP, the pages don’t even really exist until you load them, because they are generated on the fly out of existing chunks of code.

You are viewing 1 out of 4 answers, click here to view all answers.