DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Css

3 ways to add CSS to your web sites

Share

Website can not be completed without any style. So you apply CSS. When a browser reads a CSS style sheet, this formats the HTML document according to the information in the CSS style sheet.

With 3 basic ways you can add CSS in your web pages:-

1) Link your webpage with an external file:

<link href="style.css" rel="stylesheet" type="text/css">

or import CSS:

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

Read Also: Align text vertically next to an image

2) Put the css between the <head> tags:

 <!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <title>Sample page</title>
 <style type="text/css">
 div { padding-top: 10px; }
 </style>
 </head>
 <body>
 </body>
 </html>

3) add CSS using inline:

 <div style="padding-top:10px;">Your content goes here...</div>
CSS Designer

View Comments

  • Thanks, this is very useful, basically the import.
    I am new to CSS. Keep posting others.

Recent Posts

How to Create a Listing in the AWS Marketplace

The AWS Marketplace is an online store where people can buy and sell applications, services,…

16 hours ago

Authentic Online Tongits Experience Starts at https://gzone.ph/tongits

Tongits is not just a card game—it’s a feeling every Filipino knows. It reminds us…

16 hours ago

How To Strengthen Your Brand-Building Efforts?

Your brand more than developing an attractive and creative logo and infectious motto. It's the…

3 days ago

2 Main Google Display Ads Campaign Formats?

The ads shown on videos, articles, or websites are called Display ads. You can supply…

6 days ago

10 Home Security Tips to Help Protect Your Family

Home security is not just about stopping burglars. It is about protecting your family, your…

7 days ago

Benefits of an Integrated Contact Center Solution

Customer Loyalty is one of the most important things for brands today. Everyday companies come…

1 week ago