CSS — Part-1

Eishta Mittal
9 min readMay 14, 2022

CSS stands for Cascading Style Sheets

CSS Syntax

CSS Selectors

Simple Selectors

The CSS element Selector

p {
text-align: center;
color: red;
}

The CSS id Selector

// css
#para1 {
text-align: center;
color: red;
}
// html<p id="para1">Hello World!</p>
<p>This paragraph is not affected by the style.</p>

The CSS class Selector

.center {
text-align: center;
color: red;
}
//html<p class="center">Red and center-aligned paragraph.

More specific, elements with a class will be affected

p.center {
text-align: center;
color: red;
}

The CSS Universal Selector

  • The universal selector (*) selects all HTML elements on the page.
* {
text-align: center…

--

--

Eishta Mittal
Eishta Mittal

Written by Eishta Mittal

Software Engineer passionate about Frontend Engineering

No responses yet