How To Become a Master In CSS In [ 7 Days]

how to master in css 7 days

In this article, you’ll learn about Secrets of CSS (CaseCading style sheet) plus comprehensive guide to make you master in CSS in a just 7 days.

It is very easy to get started with CSS , so even if you’re a beginner then don’t worry. After some hours of learning you can start styling the element and layout etc.

Table of Content

1)What is CSS?

CSS stands for CaseCading style sheet it is a core technology developed for designing a website that will make your website look good. it becomes more important for you to learn CSS for web development career because CSS is only the stylesheet that browser understand.

3)Why Learn CSS properly?

Learning CSS in a right way is important because if you don’t have knowledge of basics CSS about how it works then you’ll definitely follow the trial and error method and that will consume lots of time.

So it’s highly recommended to learn basics of CSS properly and completely.

4)CSS Versions

CSS has a three version CSS1, CSS2 and CSS3. Higher version of CSS has comeup with advanced properties. I’ recommend you to start with CSS1.

if you learn CSS1 ,you can easily learn CSS3. CSS3 has capability of achiving same style like CSS1 but with less code.

5)What are The CSS Types?

Following are the types of CSS

1)Inline CSS

When styles are specified using style attribute in the element, then it’s called as inline CSS. You can use Inline css when you want to apply unique CSS to that element.

Remember, any CSS applied to the element using external or internal CSS will be overridden by inline CSS.

Example:

<p style="background:yellow;"></p>

2)Internal CSS

Internal CSS are given using <style> tag, all the CSS are specified in this tag and it must be placed inside the <head> tag of the document.

Internal CSS are used when you know that these CSS are only meant for current page.

Example:

<html>
<head>
<style>
/*your CSS*/
</style>
</head>
</html>

3)External CSS

In the external CSS, we maintain the CSS in the separate file having .css as file extension. Whenever we need that file in some other pages we can import the CSS file using <link> tag.

Example:

<link rel=”stylesheet” type=”text/css” href=”yourcssfile.css”>

What are the CSS basics?

1)CSS Box Model

Do you know ? Everything in the CSS has Box around it. Once you understand CSS box model structure you can play with CSS for any kind of complex layout.

CSS box model
credit: https://developer.mozilla.org/

There are two types of box model:

  1. Inline Box: Inline Box continue within the same line, here height and width property will not apply.
  2. Block Box: Block box always starts in line and height, width properties will be applied.

2) CSS Structure

Here is the CSS structure that you’ll use to apply styles on element.

 Selectors {
property name : property value;
......
}

Example:

div,p{
  border : 2px solid blue;
}

3)Selector

Selector is an element on which you want to apply the styles. There can be more than one selector on which you can apply CSS by separating comma.

Once you know how to use CSS selector for your webpage style then you can easily become a master in CSS.

Following are the popular CSS selectors:

  • Element selector
  • asterisk (*) selector
  • ID selector
  • Class selector
  • Attribute selector
  • Pseudo class
  • Pseudo element selector

4)Writing comment in CSS

Comments are considered as good practice for programming. comment starts with ” /* ” and ends with ” */”

Code added inside the comment will not be executed, this primary used for skipping the code or provide some small description about what that code does.

This also helps the other developer to understand code if multiple developer are working on same project

Example:

div {
width:200px; /*height and width of container*/
height:100px;
}

5)Adding Animation in CSS

In CSS, you can change the style of element from one style to another with the help of CSS animation.

for instance, you want to change the color of text frequently then you can use CSS animation. you can define the animation by using @keyframes and followed by the name of animation.

Example of CSS animation:

/*css animation */

@keyframes myanimation{
0%{color:red;}
50%{color:blue;}
100%{color:yellow;}
}

/*html element*/
p{
animation-name:myanimation;
animation-duration:2s;
animation-iteration-count:infinite;
}

in the above example, myanimation will be applied to p element that will change the color of p element for the every 2 seconds

FAQ About How to Become a Master in CSS?

How much time is required to learn CSS?

If you’re a beginner and know the html basics then you can easily master the CSS under one week.

What’s the best way to learn CSS?

Preliminary steps of learning CSS ,is you must know the html basics.in Addition to this practice the CSS modules step by step.