Professional Documents
Culture Documents
Web standards-CSS-MDN-Docs
Web standards-CSS-MDN-Docs
Web standards-CSS-MDN-Docs
Category: Styling
CSS enables you to add style to your web pages including color, text, positioning and
layout, and animation. In our first CSS module, we cover all the fundamental language
mechanics you need to understand how CSS works.
General resources:
Learn HTML and CSS , Scrimba
3.2 Selectors
Learning outcomes:
Basic selectors — element type, class, ID:
IDs are unique per document — you should use an ID to select one specific
element.
You can have multiple classes per element, and these can be used to layer on
styles as required.
IDs and classes should be used sparingly where they make sense for selections,
but you shouldn't use them for everything — keep your HTML as clean and
uncluttered as possible.
Selector lists.
Attribute selectors.
Combinators.
Pseudo-classes and pseudo-elements.
Resources:
CSS Selectors
CSS Selectors – Cheat Sheet for Class, Name, Child Selector List , freeCodeCamp
(2022)
margin .
border .
padding .
The alternative box model accessed via box-sizing: border-box , and why this is
easier to understand (and how it differs from) the standard box model.
Margin collapsing.
Basic display values, and how they affect box behavior — block , inline , inline-
block , and none .
Resources:
The box model
Box Model , web.dev (2019)
3.6 Sizing
Learning outcomes:
Intrinsic size.
Setting absolute and percentage sizes.
min- / max-width and min- / max-height .
Viewport units.
Resources:
Sizing items in CSS
Handling different text directions > Logical properties
Resources:
Backgrounds and borders
3.8 Overflow
Learning outcomes:
Understand what overflow is.
Control overflow with overflow properties.
Resources:
Overflowing content
Notes:
Conforming to this curriculum module doesn't require having foolproof,
conclusive answers to every possible form styling problem. Some form
elements are difficult to style, as the resources make clear. However, you
should at least be able to handle a wide range of form styling needs and
understand the issues around some of the more difficult styling issues.
Resources:
Images, media, and form elements
Styling web forms
Advanced form styling