DEV Community

Cover image for 5 Stages To Master CSS Quickly For Beginners
Prakash Mishra
Prakash Mishra

Posted on

5 Stages To Master CSS Quickly For Beginners

How to Master CSS quickly for beginners

Stage 1: CSS basics

If you are one of those people who has just started their web development then firstly you should have a very basic knowledge of HTML concepts such as headings, paragraphs, lists, tables, and many more.

Furthermore, while master CSS you should start with how CSS works in the browser and how it helps you to design a beautiful website. Here are the CSS basics you should start with:

1. Adding CSS: To begin with, you should know how to add CSS to an HTML file. There are 3 ways to add CSS i.e. Inline, Internal and External. Try to use all of them and understand which is better to add CSS in an HTML file.

2. CSS Selectors: For beginners, it’s really important to understand what are the selectors we have. It helps you to find the exact HTML element you want to add some styles.

Basically, there are 5 different types of selectors in CSS i.e. Element Selector, Id Selector, Class Selector, Universal Selector, Group Selector, and ID and Classes are the most important in all of them. In your master CSS journey, you have to use ID and Classes everywhere so clear your concepts very well.

#para1 {
  text-align: center;
  color: red;
}
Enter fullscreen mode Exit fullscreen mode

3. Display property: Display is one of the easiest but you need to pay attention while learning every display property. There are very crucial at the beginning stage.

The display property specifies the display behavior (the type of rendering box) of an element. There are different types of display properties:

 display: block | inline | inline-block | flex | grid | table | etc
Enter fullscreen mode Exit fullscreen mode

Try to give some handful time and write some code so that it will clear you very well.

4. Fonts and other formatting properties: Being a web developer it’s very important to show your creativity to the users and fonts are the best way to put a huge impact on the readers to experience the website.

There is a huge number of fonts such as Serif, Cursive, and my favorite Babloo( yeah it’s a font) that you can use on your website. To experience different fonts I will recommend you use the Google fonts website that is amazing.
So these are the basics to master CSS concepts there are many more such as font-size, width, height, margin, padding, etc. Understanding all of them will help you.

Stage 2: Element arrangement

So now we are in stage 2 where we will master CSS about float, clear, positioning, the most important box-sizing, and many more things. Let’s discuss more stage 2:

1. Float and Clear property: This property helps you to align HTML elements in a particular direction let’s say the left side. The CSS float property specifies how an element should float.

It is mainly used for the positioning and formatting elements in a direction for e.g. if you want to float an image on the right-hand side you have to use the float property. Following are the values used in float property:

float: left | right | top | bottom
Enter fullscreen mode Exit fullscreen mode

2. Positioning: Being a web developer position property is almost used by every day while developing any website. For me, it’s the most important concept that doesn’t clear in one go. You have to do practice very well.

The position the property specifies the type of positioning method used for an element (static, relative, fixed, absolute, or sticky).

Stage 3: Layouts

So now we are in stage 3 where we will see the two master CSS concepts i.e. Flexbox and grid system. The most important thing to learn before going any further is to master CSS layouts. Let’s see each one of them in a detailed way:

1. Flexbox: Designing a responsive site is much more difficult and the Flexible Box Layout Module, makes it easier to design flexible responsive layout structures without using float or positioning.

2. Grid: The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, making it easier to design web pages without having to use floats and positioning.

So both of them are mostly used for creating flexible layouts and making developers’ life much easier.

Stage 4: Responsive

One of the most important things to know how to master CSS is how to build responsive layouts. If your site is going to be accessed by a variety of devices, you’ll want to make sure that it looks good on all of them.

In order for your site to look good on all screen sizes, you’ll need to use media queries, text effects, image and video resizing, different viewports in your CSS code.

The viewport varies with the device and will be smaller on a mobile phone than on a computer screen.

1. Media queries: Media queries are used for targeting specific ranges of screen sizes and can be nested within each other.
2. Responsive web design- Image and Video: Whenever we are designing any website it should be responsive. It will look exactly the same on every device. But in the case of images and videos we have to use some properties such as width and height so that it looks exactly same on every devices.

Stage 5: Advanced

So we are in the last stage where we will see variables, transitions, animations, 2D & 3D transform, and many more things. Learning basic transforms and transitions will come in handy if you want to create an interactive web page with moving parts on mouse events or keyboard events such as hover or click.

1. Variables: The var() function is used to insert the value of a CSS variable. CSS variables have access to the DOM, which means that you can create variables with local or global scope, change the variables with JavaScript, and change the variables based on media queries.

2. CSS Transitions: CSS transitions allows you to change property values smoothly, over a given duration. Some of the properties are

transition
transition-delay
transition-duration
transition-property
transition-timing-function
3. Animations: With the help of animations you can add animations in HTML elements without using JavaScript.

Top comments (0)