Apply CSS to imported text/html

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

Moderators: egami, macek, gesf

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

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

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

Code: Select all

hr {color: sienna;}
p {margin-left: 20px;}
body {background-image: url("images/background.gif");}
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:

I hope this helps. Thank you.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest