Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2
CS 299 Web Programming and Design
Unordered HTML List
3
CS 299 Web Programming and Design
Unordered List Item Marker
An ordered list starts with the <ol> tag. Each list item
starts with the <li> tag.
The list items will be marked with numbers by default:
Example
<body>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
5
CS 299 Web Programming and Design
Ordered HTML Type Attribute
6
CS 299 Web Programming and Design
Ordered HTML Type Attribute
Example:
<body>
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
7
CS 299 Web Programming and Design
HTML Description Lists
8
CS 299 Web Programming and Design
What is CSS?
9
CS 299 Web Programming and Design
Multiple Ways to Define Style
10
CS 299 Web Programming and Design
CSS Style Rule
property names
declarations
p{
font-size: x-large ;
background-color: yellow
}
declaration block
selector string
11
CS 299 Web Programming and Design
Selector Strings
Type selector:
Element type, such as body, p, hr, etc.
See previous example
Multiple element types using the same style are separated by
comma
h1, h2, h3, h4, h5, h6 {background-color:purple}
ID selector:
#p1, #s1 {background-color: blue}
<p id=p1> </p>
<span id=s1></span>
id values are case-sensitive
12
CS 299 Web Programming and Design
Selector Strings, Continue
CSS comments
/* This is a comment */
p{
text-align: center;
/* This is another comment */
color: black; font-family: arial
}
13
CS 299 Web Programming and Design
How to Insert a Style Sheet?
External style sheet
Create a separate folder with extension.css
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Background
Color
Font
Border
Margin
Padding
Text-Align
Float
Display
Text-decoration
15
CS 299 Web Programming and Design