Cascading Style Sheets




CS174

Chris Pollett

Sep 14, 2020

Outline

Introduction

select tags

<textarea>

Stylesheets

Levels of Style Sheets

Quiz

Which of the following statements is true?

  1. A shortcut icon for a web page can be specified with a syntax like:
    <link rel="icon"   
        href="http://www.cs.sjsu.edu/faculty/pollett/favicon.ico" />
    
  2. To add an image to an HTML document we can use an <image> tag.
  3. The Web Accessibility Initiative guidelines encourage the use of tables for layout purposes.

Basics of Styles

Examples of Simple Selectors

h1 {font-size: 24pt;} /* would apply to all h1 tags in the document */

h2, h3 {font-size: 14pt;} /* notice applies to both h2 and h3 tags */

You can also specify that styles should only apply to elements in certain positions within the file:

body b i {font-size: 30pt;} /* only for bolded italic'd text within body of HTML*/

Class selectors

ID Selectors

Reset Styles, !important

Pseudo Classes

What values can a property have?