Introduction of CSS
- What does CSS stand for?
- What does CSS achieve in web pages?
- The style and layout information of the web pages.
- What are the benefits of using CSS in web pages?
- CSS can quickly and easily restyle any element.
- How to import a Style Sheet from within HTML?
-
By using the HTML <link> tag, like <link rel='stylesheet' type='text/css' href='style.css' />
- Why is it a better way to use IDs?
- For setting the style of a specific element.
- Give an example to use ID?
-
<div id='iblue'>Hello there</div>
#iblue { font-style:italic; color:blue; }
- How do you use classes?
-
For setting the styles of multiple elements.
<div class='iblue'>Hello there</div>
.iblue { font-style:italic; color:blue; }
- What is the difference between ID and Class?
-
ID is For setting the style of a specific element while class is For setting the style of a specific element.
- What are the symbols for ID and Class?
-
IDs use a # symbol while class statement use a . symbol.
- What is a CSS rule?
-
A statement or series of statements that tells the web browser how to render a certain element or elements on the page.
- What is a selector?
- The element to which the rules will be applied.
- What is a semicolon?
-
Semicolons are used to separate multiple CSS statements on the same line.
- How can you use multiple assignments?
- We can concatenate them on the same line, place them one per line, or space them out a little more.
- Why is it important to use comments?
-
Comments are explanatory statements that help anyone reading and understanding it's source code.
- What is the symbol for comments?
- What is a default style?
-
Default styles are created as a fallback for when a web page doesn't have any style defined.
- What is a user style?
-
User styles are created by users and they will override any default styles.
- What is the external style sheet?
-
External style sheets allow user to use one style sheet on multiple web pages and they will override any default styles.
- What is the internal style?
- Internal style can be used to override the styling in any external style sheets loaded in at the same time.
- What is the inline style?
- Inline styles are where you assign a property to an element.
- What is a type selector?
-
The type selector specifies the HTML element to style, such as <p> or <i>.
- What is a descendant selector?
- The descendant selector applies styles to elements that are contained within other elements.
- What is a child selector?
- The child selector selects only those elements that are direct children of another element.
- What is a ID selector?
- The ID selector styles the element with the specified id.
- What is a class selector?
- The class selector styles all elements with the specified class.