Gyancode

A free library of HTML, CSS, JS

Search This Blog

Tuesday 28 March 2017

The 3 ways to insert CSS into your web pages



1. With an external file that you link to in your web page:

<link href="myCSSfile.css" rel="stylesheet" type="text/css">
or using the import method:

<style type="text/css" media="all">
   @import "myCSSfile.css";
</style>

 

2. By creating a CSS block in the web page itself; typically inserted at the top of the web page in between the <head> and </head> tags:

<head>
   <style type="text/css">
      p { padding-bottom: 12px; }
   </style>
</head>


3. By inserting the CSS code right on the tag itself:

<p style="padding-bottom:12px;">Your Text</p>

No comments :

Post a Comment