Volume 1 of “HOW TO LEARN CSS in a Day”


Cascading Style Sheet is shortened to CSS. You can think of CSS as a design language or a style sheet language. Cascading Style Sheets, or CSS, is a simple design language created to streamline the process of creating visually appealing web pages.

CSS determines how a website looks and feels. Text color, font family, paragraph spacing, column sizing, and alignment, background image or color, layout design, display versions for different devices and screen sizes, and countless more effects can all be controlled with CSS.

CSS is straightforward to learn and use, but it grants extensive control over the visual presentation of HTML documents. The markup languages HTML and XHTML are common partners for CSS. There are two crucial concepts to understand in CSS: the functions that designate instruction for a given section and the way in which sections are organized. Only within the HTML element itself is it possible to assign these functionalities. The dual purposes are:



The class selector is a function or selection that can be applied to any HTML tag. A unique name must be chosen for the class; if another class does not wish to share the name of an existing class that performs a similar job, it must come up with a different name. Because of the time and effort saved by not having to redo the styling for each individual HTML tag, this feature is highly recommended. It’s referred to in its own unique syntax. In the CSS file, the class and its associated styles are referenced using the dot (or full stop, depending on your preference) syntax. To clarify:

HOT POST:  BENEFITS OF OOP (Object-Oriented Programming)

Furthermore, the results are:

Similar to the class selector is the id selector. The only difference between this and the class selector is that instead of using a period (.) to declare the id, the Hash (#) character is used to reference the class and its associated styles in the CSS declaration. To clarify:

Finally, the results are:


Remember anything else crucial, Any tag to which you wish to apply a selector must have its class or id declared within its opening tag. Also, remember to use a semicolon (;) as the final character in every line of CSS code.

CSS Varieties

It’s not recommended for anyone beyond novice web developers to utilize inline CSS, which is CSS code written inside an open HTML tag. In the HTML file, it looks like this:

While the browser’s output is:

Internal CSS is a subset of the CSS family; it’s not the same as inline CSS. The CSS code is present in the HTML file, but outside of the tags themselves. In the HTML file, it looks like this:

Finally, the results are:

A new file is created and saved with the “.css” extension to indicate that it is a style sheet. It won’t actually be included in the HTML file itself, but rather referred to externally using the link element. To clarify:

The HTML Document:

HOT POST:  Tesla's cheapest ever EV is coming – and it could be almost half the price of a Model 3

The CSS Document:

Keep in mind that the href attribute of the link tag needs to match the name of the CSS file. Both caps and lowercase are correct.


The time spent writing a CSS file is minimized because it can be reused across multiple HTML documents.

Cascading style sheets (CSS) make it possible to tailor material to the display capabilities of multiple device types. Using the same HTML content, sites can be delivered in a variety of formats, including those optimized for viewing on mobile devices like smartphones and tablets, as well as those optimized for printing.

EASY MAINTENANCE: Modifying the style and clicking “save” will immediately update all of the elements on all of the web pages to the new, preferred design.

In the subsequent essay on this subject, I’ll go into detail about the various CSS functions and how they can be put to good use.

Leave a Reply

Your email address will not be published. Required fields are marked *