External style sheet, can change the look of an entire website by changing just one file
Syntax:
<link rel="stylesheet" type="text/css" href="STYLE-PAGE-URL.css">
Tip:
STYLE-PAGE-URL.css should not contain any html tags. The style sheet file must be saved with a .css extension.
Example:
1- Open a new file and type the following for example
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
2- Save the file as stylesheet.css
3- In HTML page head tag write the following
<link rel="stylesheet" type="text/css" href="stylesheet.css">
open HTML in any browser to see the result!
Tip:
The :focus selector is allowed on elements that accept keyboard events or other user inputs.
Syntax:
a:focus {
css declarations;
}
Examples:
a:focus {
color:#f90;
font-size:24px;
}
When a link gets focus, gradually change its color to #f90 and its font-size to 24px.