Section 1.4 CSS Basics
Learning Objectives
After you have completed this section, you should be able to
- define cascading style sheets.
- use cascading style sheets to control the appearance of a website, so as to give all the pages of a website the same look and feel.
Activities
- Carefully read the learning objectives.
- Watch the presentation for the section;
- Read Chapter 4, Introduction to Cascading Style SheetsTM (CSS): Part 1, of the e-text.
- Read relevant documents you find at https://www.w3schools.com/css/default.asp.
- Find answers to the study questions below.
- Do exercises 4.3, 4.5, and 4.8 in Chapter 4 of the e-text.
Study Questions
- What are inline styles?
- Where do you declare an inline style, and how?
- What are embedded style sheets?
- Where should an embedded style sheet be embedded in an HTML5 document? How?
- What is the format of the CSS rules for the style sheets?
- What is a style class?
- How do you use a defined style class in your HTML5 document?
- What are conflicting styles?
- What rules are set to resolve conflicting styles?
- How do you use an external style sheet in a HTML5 document?
- How do you validate your cascading style sheets?
- What is the positioning property provided by CSS?
- What is absolute positioning?
- How do you use the absolute positioning property in an inline style sheet to control the position of an HTML5 element?
- What is relative positioning?
- How do you define relative positioning in embedded style sheets and use them in your HTML5 documents?
- When should relative positioning be used in an HTML5 document?
- How can you use CSS to control the background of HTML5 elements?
- How do you control the dimensions of elements using CSS?
- What is text flow?
- What is the box model?
- How do you control text flow in HTML5 documents using CSS?
- What are the margins, borders, and padding of a box model?
- What border styles can a box model have?
- What are author styles?
- What are user styles?
- Where are user style sheets set?
- When a conflict between user style and author style occurs, what rules are set to solve such conflicts?
Review
Do the self-review exercises in Chapter 4 of the e-text.
Summary
Read the Chapter 4 summary.