CSS Interview Questions and Answers
Question: Three selectors: h1, .warning and #footer, what they do?Answer: An element points at a HTML-tag somewhere on your page. In the example above we want to style the -tag. Note that using an element like that affects all tags with that name, so using p { margin-left: 100px; } gives all-tags a left-margin. and , that is, any element with the class warning. Classes are used when you want to style just a few of your tags in a way, perhaps you want some of your links red? Add a class to all those links. You need one more building block: the id. This time you style an element with the attribute ?id? set to the id you have chosen. Ids work exactly like classes except for one thing; you can only have one id with a certain name in each of your HTML documents. In the example above we style |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is CSS?
- What are Cascading Style Sheets?
- As a reader, how can I make my browser recognize my own style sheet?
- How do I combine multiple sheets into one?
- What are Style Sheets?