🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
All Subjects
Free · 195 Topics · No Signup

CSS Notes

Style and lay out web pages — selectors, box model, flexbox, grid and responsive design — written by CodingNow 2.0's mentors. Free to read, structured to actually help you learn.

CSS notes by CodingNow 2.0 cover 195 topics — from css home to rwd templates — each explained with short definitions, syntax and runnable code examples. They are 100% free, need no signup, and work as quick revision for college exams, CSS interviews and CodingNow 2.0's mentor-led CSS course in Pitampura, Delhi.

No notes found. Try a different search term, or browse all CSS notes.

CSS Tutorial

115 of 115 topics published
1

CSS HOME

CSS is the language we use to style an HTML document.

2

CSS Introduction

CSS is the language we use to style a Web page.

3

CSS Syntax

A CSS rule consists of a selector and a declaration block:

4

CSS Selectors

CSS selectors are used to "find" (or select) the HTML elements you want to style.

5

Grouping Selectors

The universal selector ( ) selects all HTML elements on the page.

6

CSS How To

When a browser reads a style sheet, it will format the HTML document according to the information in the style sheet.

7

Add Internal CSS

An internal style sheet may be used if one single HTML page has a unique style.

8

Add Inline Style

An inline style may be used to apply a unique style for a single element.

9

Multiple Style Sheets

If some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used.

10

CSS Comments

Comments are used to explain the CSS code, and may help when you edit the source code at a later date.

11

CSS Errors

Errors in CSS can lead to unexpected behavior or styles not being applied correctly.

12

CSS Colors

In CSS, colors are specified by using a predefined color name, or with a RGB, HEX, HSL, RGBA, HSLA value.

13

RGB / RGBA

An RGB color value represents RED, GREEN, and BLUE light sources.

14

HEX / HEXA

A hexadecimal color is specified with: RRGGBB.

15

HSL / HSLA

HSL stands for hue, saturation, and lightness.

16

CSS Backgrounds

The CSS background properties are used to add background effects for elements.

17

Background Image

The background-image property specifies an image to use as the background of an element.

18

Background Repeat

The background-repeat property sets if/how a background image will be repeated.

19

Background Attachment

The background-attachment property specifies whether the background image should scroll or be fixed (will not scroll with the rest of the page):

20

Background Shorthand

To shorten the code, it is possible to specify all the background properties in one single property. This is called a shorthand property.

21

CSS Borders

The CSS border properties allow you to specify the style, width, and color of an element's border.

22

Border Width

The border-width property specifies the width of the four borders.

23

Border Color

The border-color property is used to set the color of the four borders.

24

Border Sides

From the examples on the previous pages, you have seen that it is possible to specify a different border for each side.

25

Border Shorthand

Like you saw in the previous page, there are many properties to consider when dealing with borders.

26

Rounded Borders

The border-radius property is used to add rounded borders to an element:

27

CSS Margins

The CSS margin properties are used to create space around elements, outside of any defined borders.

28

Margin Collapse

Margin collapse is when two margins collapse into a single margin.

29

CSS Padding

The CSS padding properties are used to generate space around an element's content, inside of any defined borders.

30

Padding box-sizing

The CSS width property specifies the width of the element's content area. The content area is the portion inside the padding, border, and margin of an element

31

CSS Height / Width

The CSS height and width properties are used to set the height and width of an element.

32

Min / Max

The min-width and max-width properties are used to set the minimum and maximum width of an element.

33

CSS Box Model

In CSS, the term "box model" is used when talking about web design and layout.

34

CSS Outline

An outline is a line that is drawn around elements, OUTSIDE the borders, to make the element "stand out".

35

Outline Width

The outline-width property specifies the width of the outline, and can have one of the following values:

36

Outline Color

The outline-color property is used to set the color of the outline.

37

Outline Shorthand

The outline property is a shorthand property for setting the following individual outline properties:

38

Outline Offset

The outline-offset property adds a space between an outline and the edge/border of an element. The space between an element and its outline is transparent.

39

CSS Text

CSS has a lot of properties for styling and formatting text.

40

Text Alignment

In this chapter you will learn about the following properties:

41

Text Decoration

The CSS text-decoration property is used to control the appearance of decorative lines on text.

42

Text Decoration Styles

The CSS text-decoration-style property sets the style of the decoration line.

43

Text Transformation

The CSS text-transform property is used to control the capitalization of text in an element.

44

Text Spacing

CSS has several properties to control text spacing.

45

Text Shadow

The text-shadow property adds shadow to text.

46

CSS Fonts

Choosing the right font has a huge impact on how the readers experience a website.

47

Font Web Safe

Web safe fonts are fonts that are universally installed across all browsers and devices.

48

Font Fallbacks

Below are some commonly used font fallbacks, organized by the 5 generic font families:

49

Font Style

The CSS font-style property specifies the font style for a text..

50

Font Size

The CSS font-size property is used to specify the size of the text/font.

51

Font Google

If you do not want to use any of the standard fonts in HTML, you can use Google Fonts.

52

Font Pairings

Great font pairings are essential to great design!

53

Font Shorthand

To shorten the code, it is possible to specify all the individual font properties in one declaration.

54

CSS Icons

Icons can easily be added to your HTML page, by using an icon library.

55

Icons: Bootstrap

To use the Bootstrap glyphicons, add the following line inside the <head section of your HTML page:

56

Icons: Google

To use the Google icons, add the following line inside the <head section of your HTML page:

57

CSS Links

HTML links can be styled with many CSS properties, like color , text-decoration , background-color , font-size , font-weight , font-family , etc.).

58

Link Buttons

CSS can be used to create HTML link buttons:

59

CSS Lists

In HTML, there are two main types of lists:

60

CSS Tables

HTML tables can be greatly improved with CSS:

61

Table Size

The CSS width property is used to set the width of a table.

62

Table Alignment

The CSS text-align property is used to set the horizontal alignment of the content in <th or <td .

63

Table Styling

To add some more space between the inner borders and the content in a table, use the padding property on <td and <th elements:

64

Table Responsive

A responsive table will display a horizontal scrollbar if the screen is too small to display the full content.

65

CSS Display

The display property is an important CSS property for controlling layout. It specifies whether an HTML element is treated as a block or an inline element.

66

Visibility / Hide

When using display: none; the element is completely hidden from the document flow and does not take up any space.

67

CSS Max-width

The max-width property defines the maximum width of an element.

68

CSS Position

CSS positioning is about controlling the placement of elements within a web page.

69

Fixed/Absolute Position

An element with position: fixed; is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled. The top,

70

Sticky Position

An element with position: sticky; toggles between a relative and fixed position, depending on the scroll position.

71

CSS Position Offsets

Positioning with top, right, bottom, and left

72

CSS Z-index

The z-index property specifies the stack order of positioned elements.

73

CSS Overflow

The CSS overflow property controls what happens to content that is too big to fit into an area.

74

Overflow X and Y

The overflow-x and overflow-y properties allow you to control overflow behavior independently for horizontal and vertical directions.

75

CSS Float

The float property specifies how an element should float within its container.

76

Clear / Clearfix

The clear property specifies what should happen with the element that is NEXT to a floating element.

77

Float Examples

With the float property, it is easy to float boxes of content side by side:

78

CSS Inline-block

The display: inline-block property combines the features of both inline and block elements.

79

CSS Align

With CSS, you can center elements (horizontally, vertically, or both) with several methods, depending on the type of element.

80

Horizontal Align

There are several ways to horizontally center elements in CSS, depending on the type of element.

81

Vertical Align

Vertical centering in CSS can be achieved using modern layout techniques like Flexbox and Grid, or using positioning with transforms.

82

CSS Combinators

A combinator is something that defines the relationship between two or more selectors.

83

CSS Pseudo-classes

A CSS pseudo-class is a keyword that can be added to a selector, to define a style for a special state of an element.

84

Interactive

Interactive pseudo-classes apply styles based on user interaction with elements.

85

Structural

Structural pseudo-classes select elements based on their position in the document tree.

86

CSS Pseudo-elements

A CSS pseudo-element is a keyword that can be added to a selector, to style a specific part of an element.

87

Text

Pseudo-elements for text, allow you to style specific parts of text content, such as the first line or first letter.

88

Content

Pseudo-elements for content allow you to insert content before or after elements, style list markers, and more.

89

CSS Opacity

The opacity property specifies the opacity/transparency of an element.

90

CSS Navigation Bars

A navigation bar is an important component of web design.

91

Vertical Navbar

In a vertical navigation bar, the navigation links are stacked vertically (on top of each other), and is typically aligned along the left or right side of a web

92

Horizontal Navbar

In a horizontal navigation bar, the navigation links are stacked horizontally (next to each other), and is typically aligned on the top of a webpage.

93

CSS Dropdowns

CSS dropdowns are used to display a list of options or content when a user clicks or hover over an element, like a button or a navigation link.

94

Advanced Dropdowns

If you want the dropdown menu to go from right to left, instead of left to right, add right: 0;

95

CSS Image Gallery

A CSS image gallery is a collection of images that is displayed in an organized, and often responsive way, on a web page.

96

CSS Image Sprites

An image sprite is a collection of various small images put into one larger image file, called a "sprite image".

97

CSS Attribute Selectors

CSS attribute selectors are used to select and style HTML elements with a specific attribute or attribute value, or both.

98

Advanced Attr Selectors

Advanced attribute selectors match elements based on partial attribute values using special operators.

99

CSS Forms

CSS is used to style HTML forms. The look of an HTML form can be greatly improved with CSS:

100

Style Inputs

With CSS, you can style most of the different input types, like text fields, password fields, checkboxes, radio buttons, and file inputs. You can also style inp

101

Input Focus / Icons

By default, some browsers will add a blue outline around the input when it gets focus (clicked on). You can remove this behavior by adding outline: none; to

102

Other Form Elements

By default, a <textarea can be resized with a "grabber" in the bottom right corner. To remove the grabber, set the resize property to none :

103

CSS Counters

With CSS counters, you can create dynamic numbering of elements (like headings, sections, or list items) without using JavaScript.

104

Nested Counters

You can create multiple counters for different levels of numbering. The following example creates one counter for the page (named "section") and one counter for

105

CSS Units

CSS units are used to define the length and size of several properties.

106

Absolute Units

Absolute units are fixed, and the length expressed in any of these will appear exactly that size.

107

Relative Units

Relative units specify a length relative to another length property (like parent element, root element, or viewport).

108

CSS Inheritance

CSS inheritance is about what happens if no value is specified for a property on an element.

109

CSS Specificity

CSS specificity is an algorithm that determines which style declaration is ultimately applied to an element.

110

Specificity Hierarchy

Each type of CSS selector has a position in the specificity hierarchy, and the selector types carry different "weights".

111

CSS !important

The !important rule is used to give the value of a specific property the highest priority.

112

CSS Math Functions

CSS math functions allow mathematical expressions to be used as property values.

113

CSS Optimization

Optimizing CSS makes your website load faster and run more smoothly; which also results in a better user experience.

114

CSS Accessibility

A website should be designed to ensure good accessibility for all users, including those with disabilities.

115

CSS Website Layout

A website is often divided into multiple sections, like a top header, navigation menu, main content, and a footer:

CSS Advanced

55 of 55 topics published
116

CSS Rounded Corners

The CSS border-radius property is used to create rounded corners for elements.

117

CSS Border Images

With the CSS border-image property, you can define an image to be used as the border around an element.

118

CSS Backgrounds

CSS allows you to add multiple background images for an element, through the background-image property.

119

Background Size

The background-size property allows you to specify the size of background images.

120

Background Origin

The CSS background-origin property specifies where the background image is positioned.

121

Background Clip

The CSS background-clip property defines how far the background (color, image, or gradient) should extend within an element.

122

CSS Colors

CSS supports 140+ color names, RGB values, HEX values, and HSL values. In addition, there are RGBA values, HEXA values, HSLA values, and the opacity property.

123

Color Keywords

CSS has some special predefined color keywords that can be used with properties like color , background-color and border-color .

124

CSS Gradients

The CSS gradient functions let you display smooth transitions between two or more colors within an element.

125

Radial Gradients

The CSS radial-gradient() function creates a radial gradient.

126

Conic Gradients

The CSS conic-gradient() function creates a conic gradient.

127

CSS Shadows

The CSS text-shadow property applies a shadow to text.

128

Box Shadow

The CSS box-shadow property is used to apply one or more shadows to an element.

129

CSS Text Effects

CSS has some properties to handle text overflow, word wrapping, line breaking rules and writing modes.

130

CSS Custom Fonts

The CSS @font-face rule allows you to define and load custom fonts for use on a webpage.

131

CSS 2D Transforms

The CSS transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, and skew elements.

132

Scale

The scale() function increases or decreases the size of an element (according to the parameters given for the width and height).

133

Skew / Matrix

The skewX() function skews an element along the X-axis by the given angle.

134

CSS 3D Transforms

The CSS transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, and skew elements.

135

3D Perspective

To activate a 3D space, the element needs perspective. The perspective defines the distance between the user's viewpoint and the object.

136

CSS Transitions

CSS transitions allows you to change property values smoothly, over a given duration.

137

Transition Timing

The transition-timing-function property specifies the speed curve of the transition effect.

138

CSS Animations

CSS allows animation of HTML elements without using JavaScript!

139

Animation Timing

The animation-delay property specifies a delay for the start of an animation.

140

Animation Properties

This page covers the CSS animation direction, fill mode, and the shorthand property.

141

CSS Tooltips

A CSS tooltip is used to specify extra information about something when the user moves the mouse pointer over an element:

142

Tooltip Arrows

To create an arrow that should appear from a specific side of the tooltip, add "empty" content after tooltip, with the pseudo-element class ::after together w

143

CSS Image Styling

You can use the border-radius property to create rounded images:

144

Image Effects

The opacity property specifies the opacity/transparency of an element.

145

Hover Overlays

Move your mouse over the image to flip it horizontally:

146

CSS Image Modal

A modal image gives a user the ability to display a larger version of an image, without navigating away from the current page. When a user clicks on a modal ima

147

CSS Image Centering

With CSS, you can center images with several methods.

148

CSS Image Filters

The CSS filter property is used to add visual effects (like blur and saturation) to elements.

149

CSS Image Shapes

With CSS it is easy to shape (clip) images to circles, ellipses and polygons.

150

CSS object-fit

The CSS object-fit property is used to specify how an <img or <video should be resized to fit its container.

151

CSS object-position

The CSS object-position property is used together with the object-fit property to specify how an <img or <video should be positioned with x/y coordinates

152

CSS Masking

CSS masking allows you to create a mask layer to place over an element to partially or fully hide portions of the element.

153

Masking - Gradients

CSS gradients can also be used as the mask layer image.

154

Masking - SVG

The SVG <mask element can be used to apply a mask to an image.

155

CSS Buttons

With CSS, different HTML buttons can be styled in many ways.

156

Hover Effects

This page covers CSS button hover effects, shadows, disabled states, and width.

157

Button Groups

This page covers CSS button groups and animated buttons.

158

CSS Pagination

Learn how to create a responsive pagination using CSS.

159

Pagination Styles

This page covers advanced pagination styling including hover effects, transitions, and breadcrumbs.

160

CSS Multiple Columns

The CSS Multi-column Layout Module allows easy definition of multiple columns of text - just like in newspapers:

161

Multiple Column Rules

This page covers CSS column rules, span, and width properties.

162

CSS User Interface

In this chapter you will learn about the following CSS user interface properties:

163

CSS Variables

The var() function is used to insert the value of a CSS variable.

164

Overriding Variables

Override Global Variable With Local Variable

165

Variables and JavaScript

CSS variables have access to the DOM, which means that you can change them with JavaScript.

166

Variables in MQ

Media Queries are about defining different style rules for different devices (screens, tablets, mobile phones, etc.). You can learn more Media Queries in our Me

167

CSS @property

The @property rule is used to define custom CSS properties (CSS variables) directly in the stylesheet without having to run any JavaScript.

168

CSS Box Sizing

The CSS box-sizing property defines how to calculate the width and height of an element: should the calculation include padding and borders, or not.

169

CSS Media Queries

CSS media queries allow you to apply styles based on the characteristics of a device or the environment displaying the web page.

170

MQ Examples

Media queries are a popular technique for delivering a tailored style sheet to different devices.

Ready to go from notes to a real career?

Join CodingNow 2.0's CSS course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.

Enroll Now — Free Demo Available

CSS Notes – FAQs

What students search before reading CSS notes.

Yes — all 195 CSS topics on CodingNow 2.0 are completely free with no signup or paywall. Read them in the browser on mobile or desktop.
This hub covers 195 structured CSS topics — from absolute basics to advanced, interview-ready concepts — each with short explanations and working code examples.
The notes are written to be self-study friendly, but for job-ready skills, projects and placement support, CodingNow 2.0's mentor-led CSS course in Delhi (online + classroom) is the fastest path.
Yes. Each topic is concise and example-driven — ideal for last-minute revision before college exams, campus placements and CSS job interviews in India.
Working AI/ML engineers and full-stack developers from CodingNow 2.0 – Gurukul of AI, Pitampura Delhi, aligned with our 2026 course curriculum.
WhatsApp
Call NowEnroll Now