What are the best ways to insert an CSS file

The first little bit starts with what CSS is and why we use it.

CSS means (cascading style sheets) which is used to design webpages so that a user can get a better experience whenever he visits the website. It also manages the layout of websites.

WHY DO WE USE IT

We use CSS because it is a core technology for web development. It works on multiple platforms like mobile, desktop or tablet.

We use CSS because it is lightweight and easy to use for web developers. And with CSS we can give colors, backgrounds, fonts, spacing, animations, etc to the website so that users can get a better experience.

CSS can also be used to make better UI (User Interface) for websites and with the help of CSS we can also enhance the better UX (User Experience ) for the client.

What are the different ways to bring CSS into an HTML file?

There are 3 different methods to add CSS to an HTML document.

INLINE CSS

In this method, we add CSS directly to an HTML element with the help of style attributes.

E.g

<p style=”font-size: 4px; color: green”>Hii i am inline css</p>

INTERNAL CSS

In this method, we add CSS to an HTML document directly to his <head >tag with the help of the style attribute.

E.g

<head>

<style>

p{

Color: Red;

Font-size:4px

}

</style>

</head>

EXTERNAL CSS

According to developers, this method is known as the best way to add CSS to an HTML document. In this method, we create a separate CSS file with a CSS extension and link it to the HTML document with help of <link> tag.

E.g

<link rel=”stylesheet” href=”style.css”/>

I hope this will help you thank you for reading. keep learning.