How to include css on web Page?

keenan88b7
keenan88b7

Posted On: Apr 10, 2020

 

There are three ways to include a CSS file in the web page. They are,

External CSS

Here, an external CSS file is linked to an HTML page to apply the changes created in that file.

//example of linking external CSS file
<link rel="stylesheet" type="text/css" href="mystyle.css">

Internal CSS

Here, a separate CSS block is inserted into the HTML page. This CSS code is defined within the </style> tag.

//example of </style> tag definition
<style>
body {
  background-color: black;
}
}
</style>

Inline CSS

Here, each CSS style is embedded in the HTML tags to apply style for than a single element.

//example of Inline CSS
<p style="color:red;">This is a paragraph.</p>

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Front End Developer Interview Questions

    What is HTML?

    HTML (HyperText Markup Language) is a markup language to design the web page. It is used to display the contents of the web page in order. They are the building blocks of the HTML pages. This text-bas...

    Front End Developer Interview Questions

    What is Ajax?

    Ajax (Asynchronous Javascript and XML) is a technique to create asynchronous web applications. Applications developed with Ajax can send and retrieve data asynchronously from the server without interf...

    Front End Developer Interview Questions

    What is npm?

    NPM stands for Node Package Manager. It is used to install, uninstall, update packages for Javascript Programming Language. NPM also is a default package manager for Node.js....