What is CSS? How to Learn It?
CSS works together with HTML. While HTML structures the web page, CSS is used for design and styling. To create a proper web design, it is essential to understand and interpret both HTML and CSS.
What Are the Basic Concepts of CSS?
CSS code consists of two main components:
Elements
These are the HTML elements such as p, ul, li, ol, td, tr, i, a, em, div, etc.
Styles:
CSS styles are used to control every visual property of these elements—from their position, color, font size, and spacing to many other design details.
Example:
p { color: red; background-color: white; text-align: center; }
In the example above, we changed the text color inside the p element to red, set the background color to white, and centered the text horizontally within the paragraph.
Using CSS IDs and Classes
If a style will be used on multiple elements, it should be written using a class name such as .class-name.
Example:
.kutu-container { background-color: black; color: white; }
<div class="kutu-container"></div>
<div class="kutu-container"></div>
<div class="kutu-container"></div>
In the example above, all the boxes share the same style. Any change you make to this single class will apply to every box automatically.