NextGenEd - CSS Course





Start CSS Course

CSS Modules

About CSS

CSS (Cascading Style Sheets) is a language used to style and layout web pages. It controls the color, font, spacing, positioning, and many other aspects of HTML elements.

CSS Syntax

CSS syntax consists of a selector and a declaration block:

selector {
  property: value;
}

Example:

p { color: red; font-size: 18px; }
CSS Selectors

Selectors are used to target HTML elements. Common selectors:

CSS Comments

Comments in CSS are written like this:

/* This is a CSS comment */
CSS Colors

Colors can be defined using names, HEX, RGB, RGBA, HSL, and HSLA values.

color: red;
color: #ff0000;
color: rgb(255,0,0);
color: rgba(255,0,0,0.5);
color: hsl(0, 100%, 50%);
CSS Box Model

The box model describes the design and layout of elements:

CSS Box Model
CSS Links

Links can be styled using the :link, :visited, :hover, and :active pseudo-classes.

a:link { color: blue; }
a:visited { color: purple; }
a:hover { color: red; }
a:active { color: green; }
CSS Lists

Lists can be styled using list-style-type, list-style-image, etc.

ul { list-style-type: square; }
ol { list-style-type: upper-roman; }
CSS Tables

Tables can be styled for borders, spacing, and more:

table, th, td { border: 1px solid black; border-collapse: collapse; }
th, td { padding: 8px; }
CSS Comments

CSS comments are ignored by browsers and help document your code:

/* This is a comment */
CSS Display & Positioning

Control how elements are displayed and positioned:

🎉 Certificate of Completion 🎉

This is to certify that you have successfully completed the CSS course.

You have learned:

Congratulations on your achievement!