Apply CSS to imported text/html

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
User avatar
WebOutGateway
New php-forum User
New php-forum User
Posts: 65
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines
Contact:

Mon Jun 09, 2014 7:47 pm

Hi, jogoland!

There are actually three (3) ways to do it:

(1) External Style Sheet when applied to many pages:

Code: Select all

<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
(2) Internal Style Sheet when applied to a single document:

Code: Select all

<head>
<style>
hr {color: sienna;}
p {margin-left: 20px;}
body {background-image: url("images/background.gif");}
</style>
</head>
and (3) Inline Style:

Code: Select all

<p style="color:sienna;margin-left:20px;">This is a paragraph.</p>
For the first one, you should create a file with the extension .css and link it in your HTML file. To learn more about CSS, you can visit this site: http://www.w3schools.com/css/default.asp

I hope this helps. Thank you.

Post Reply