Chapter 4 : Introduction to CSS Flashcards
What is the full name of css?
- Cascading Style Sheets
Why do we need to use CSS?
- To seperate structure ( HTML ) from presentation
What does a style sheet contain?
- A style sheet contains instructions that define how to display HTML elements in a web page
What is the file format for an external style sheet?
- .css
List out 3 types of CSS
- Inline
- Embedded
- External
What element that inline styles declares? ( 2 )
- Indicidual element’s format
- A one-time style instruction placed in an individual HTML tag
< p style=”font-size: 20pt; color: #ffffff”>< / p >
What is the disadvantages of using inline styles? ( 2 )
- Not taking the full advantage of the true power of CSS
- Not separating content from presentation
Where is embedded style sheets declared?
- In HTML’s < head > section
List out some CSS property ( 4 )
- Multipurpose Internet Mail Extensions ( MIME ) Type
- Describes a file’s content
- background-color
- font-family
- font-size
Which HTML file that embedded style sheets effects?
- The style of the page on which it is written
<style>
h1 { font-size : 30px }</style>
What can external style sheets do?
- Provide uniform look and feel to entire site
- One external style sheet can control the appearance of many web pages
What is the advantages of using an external style sheets?
- Maintain a consistent look across all pages that link to the style sheet
- Easily update the look of all pages by changing the values in one file
- Make your pages much smaller and quicker to download, because all of the style information has been removed to one file
How to refer the HTML file to use the external style sheets?
<link></link>
What will happen when multiple style instructions exist?
- It will “cascade” into a single set of instructions, with some instructions taking priority over others
List out the priority for CSS styles ( 4 )
- Inline Styles
- Embedded Style Sheet
- External Style Sheet
- Browser Default
What will happen when 2 styles applied to the same text?
- The browser displays all attributes of both styles unless specific attributes conflict
What will HTML formatting do to CSS formatting?
- It wil override any CSS formatting
What will implement CSS differently? What is the best practices to address this issue?
- Different Browsers
- Test your web pages in a variety of browsers to make sure your pages display correctly
What will happen if attributes from 2 styles applied to the same text conflict?
- The browser displays the attribute of the innermost style ( The style closest to the text itself )
What is a HTML selectors?
- Are the text part of a HTML tag and are used to define the behavior of the specific HTML tag
- h1 is the selector for <h1> tag
- Although HTML tag and the selector appear to be identical, they are not the same
- The HTML selector is used to control the behavior of its specific HTML tag
- h1 { font-family: arial, sans-serif }
List out 2 selectors for CSS Styling
- HTML selectors
- Class selectors
What does class selectors do?
- Are selectors that you create from scratch
- They can be applied to any HTML tag
.userDefineName { font-size: 14pt, color: blue }