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

Understanding Battery Coating: Key Factors to Perfection

Battery coating is the process of applying uniform layers of active materials—such as cathode and…

12 hours ago

Edge Computing vs Cloud Computing: What’s the Difference?

Let’s face it. Tech buzzwords get thrown around a lot—especially when it comes to how…

3 days ago

How Data Intelligence Shapes the Future of Digital Innovation

In today’s digital world, the boundaries between technology, finance, and innovation are rapidly disappearing. Businesses…

7 days ago

How To Power Your Backyard Parties with A Solar Power Battery?

Backyard gatherings like BBQs, family reunions, and garden parties are an exciting way to enjoy…

1 week ago

5 Best Practices for Programmatic Advertising

Marketers are always on the lookout for more effective ways to reach their target audiences.…

1 week ago

Are We All Addicted to Stimulation? The New Face of Anxiety Disorders

Does your phone control your mind more than you control your phone? Modern life exploits…

1 week ago