• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Explain how can you integrate CSS file to your webpage?

If you have your CSS code in an external CSS file say "style.css", use this method,

HTML:
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

If you want to include CSS inside your HTML document, use the <style> tag as in this method,

HTML:
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: blue;}
h1   {color: black;}
p    {color: red;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Or you can use Inline CSS like this (not recommended),

HTML:
<h1 style="color:blue;">This is a Blue Heading</h1>
 
Back
Top