CSS3_Exam_Summary
CSS3_Exam_Summary
1. Introduction to CSS3
Definition: Cascading Style Sheets (CSS) define the visual appearance of HTML content.
2. Writing CSS
Inline: Directly within HTML elements using the 'style' attribute (least recommended).
Internal: Within a <style> block inside the <head> section of an HTML file.
External: In a separate .css file linked via <link> in HTML (most recommended).
4. CSS Syntax
Selector {
property: value;
Advanced:
-
6. The Cascade and Priority
External < Internal < Inline styles in terms of specificity.
Later rules in the stylesheet override earlier ones for the same selector.
7. Styling Text
font-size:
font-family: Use generic families (e.g., Serif, Sans-serif, Monospace, Cursive, Fantasy).
8. Colors
Text: color:
Background: background-color:
Formats: Named colors (e.g., Red), Hex codes (e.g., #FF5733), or RGB (rgb(255, 0, 0)).
- Content.
Example:
.box {
padding: 10px;
margin: 15px;
position:
- Static: Default.
Example:
}
12. Dynamic Pseudo-classes
:hover: When the user hovers over an element.
:active: When an element is being clicked.
:visited : lorsqu'un lien a déjà été visité.
:focus: When an element is selected.
Example:
a:hover { color: red; }