How to Call CSS (Let’s Check The Explanation!)

[ad_1]

How to Call CSS
How to Call CSS

How to Call CSS – Hi friends, meet us again. How are you friends today? We hope you are always in good health. In this article, we will discuss about the CSS Programming Language in the section on how to call it. The hope is that this article can help beginners who are just entering the world of programming.

Often I come across beginners in the programming world who mix css into one in HTML tags. Well, this will later make your program code look complicated and will make it difficult when you will change the style later because you have to change one by one. Therefore, in this discussion we will learn how to write and call CSS correctly.

CSS Calling Method

In general, there are 3 ways to call CSS, including External, Internal and Inline. External method means calling CSS from outside or not in the same file. Internal by writing them in the same file. And inline is a method that inserts css in HTML tag directly.

  1. MethodExternal
    external mode
    external mode

    as previously explained, calling css externally is by creating separate HTML and CSS files. This method is the most popular method, and is highly recommended if you write a lot of scripts or code. The method of calling is as follows:

    External method call
    External method call

But that’s just an example, the name of the css file doesn’t have to be style.css, if the name of your css file is not style.css please replace href=”style.css” in the image above with your css file name.

2. Internal Method

internal mode
internal mode

The second method is to mix Html with css scripts which are essentially in the same file. The second method is a way that writes css scripts in

tags wrapped in tags. This method is suitable if you don’t want to give too much style or css.

3. Inline Method

Inline method
Inline method

the inline method is equivalent to inserting CSS in an HTML tag directly using the style attribute. This method is suitable if you want to style a single element.

So much information that we can convey, hopefully useful, thank you.



[ad_2]