Lecture 8
Lecture 8
2023/05/27
Contents
▪ CSS Lists
▪ CSS Tables
▪ CSS Display
▪ CSS Position
▪ CSS Pseudo Classes
▪ CSS Pseudo Elements
▪ CSS Opacity
▪ CSS3 Gradients
2
CSS Lists
3
CSS Lists
4
All CSS List Properties
Property Description
list-style Sets all the properties for a list in one
declaration
list-style-image Specifies an image as the list-item marker
list-style-position Specifies if the list-item markers should appear
inside or outside the content flow
5
All CSS List Properties
6
CSS Tables
Property Description
border Sets all the border properties in one declaration
border-collapse Specifies whether or not table borders
should be collapsed
border-spacing Specifies the distance between the borders of adjacent
cells
caption-side Specifies the placement of a table caption
empty-cells Specifies whether or not to display borders
and background on empty cells in a
table
table-layout Sets the layout algorithm to be used for a table
7
CSS Tables
8
CSS Layout - The display Property
9
CSS Layout - The display Property
10
CSS Layout - The position Property
11
Static Position
12
Relative position
13
Fixed Position
14
Absolute Position
15
Sticky Position
16
CSS Layout - The position Property
17
CSS Pseudo-classes
18
CSS Pseudo-classes
Selector Example Example description
:active a:active Selects the active link
:checked input:check Selects every checked <input> element
e d
:disabled input:disabl Selects every disabled <input> element
e d
:empty p:empty Selects every <p> element that has no children
:enabled input:enabl Selects every enabled <input> element
e d
:first-child p:first-child Selects every <p> elements that is the first child of its
parent
:first-of-type p:first- Selects every <p> element that is the first <p> element of
of- its parent
type
:focus input:focus Selects the <input> element that has focus
:hover a:hover Selects links on mouse over
19
CSS Pseudo-Elements
20
CSS Pseudo-Elements
Selector Example Example description
::after p::after Insert content after every <p> element
22
CSS Opacity
23
CSS Opacity
24
CSS3 Gradients
CSS3 gradients let you display smooth transitions between two
or more specified colors.
Earlier, you had to use images for these effects. However, by using
CSS3 gradients you can reduce download time and bandwidth
usage. In addition, elements with gradients look better when
zoomed, because the gradient is generated by the browser.
CSS3 defines two types of gradients:
• background: linear-gradient(direction, color-stop1, color-stop2, ...);
• background: radial-gradient(shape size at position, start-color, ..., last-color);
25
CSS3 Gradients
26
THANKYOU
[email protected]