CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
beatsigner.com
2 December 2005
Cascading Style Sheets (CSS)
▪ Separation of presentation and content
▪ visualisation of HTML elements defined by styles
▪ enables multiple presentations of the same content
▪ media-specific style sheets via the media attribute
<html>
<head>
...
<link rel="stylesheet" type="text/css" href="default.css"
media="screen, tv" />
<link rel="stylesheet" type="text/css" href="alternative.css"
media="print, handheld" />
</head>
<body>
...
</body>
</html>
Font Color
Transforms Paged
Properties + Back- Multi-
Selectors Media
ground Column
Transitions
CSS Text
Cascade Syntax Speech
Properties
Ruby
Pseudo Box Syntax
Classes Properties L3
Grid
Layout Flexible
Layout
Web
Animations Basic
Selectors UI
Masking
L4
based on https://en.wikipedia.org/wiki/Cascading_Style_Sheets
▪ Example
h1 {
color: red;
font-size: 10px;
}
▪ Element/Type selector
▪ specific element names
p { ... }
h1, h2, h3 { ... } /* also called grouping selector */
▪ ID selector
▪ element with a specific value for the id attribute
#intro { ... } /* always more weight than class selector */
▪ Child selector
▪ elements that are direct children of other elements
p>a { ... }
▪ Descendant selector
▪ elements that are descendants of other elements
p a { ... }
p { color: blue; }
p {
padding: inherit; /* explicitly inherited from parent element */
}
<html>
<head>
...
<link rel="stylesheet" type="text/css" href="default.css" />
</head>
<body>
...
</body>
</html>
<article> <aside>
<footer>
▪ CSS Tutorial
▪ https://www.w3schools.com/css/
▪ W3.CSS
▪ https://www.w3schools.com/w3css/
2 December 2005