Intergrating HTLM and CSS for website programming

Asked By 0 points N/A Posted on -
qa-featured

I have an Html based website and I wanted to able to inter grate the CSS interface in the page, how can I achieve this? Is it possible to incorporate the html interface so that it can fully be compatible with CSS and how would this be achieved? I look forward to a positive response

SHARE
Answered By 0 points N/A #192332

Intergrating HTLM and CSS for website programming

qa-featured

Hi,

Yes you can embed css in your HTML Page.

There are threetypes for embedding style to ypur HTML page.

1) Internal

Internal Stylesheet is defined in <head> </head> tag.

2) External

The following short CSS style sheet (stored in the file "special.css"), sets the text color of a paragraph to green and surrounds it with a solid red border:

P.special {

color : green;

border: solid red;

}

 

You may link this style sheet to their source HTML document with the LINK element:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
  <HEAD>
    <LINK href="special.css" rel="stylesheet" type="text/css">
  </HEAD>
  <BODY>
    <P class="special">This paragraph should have special green text.
  </BODY>
</HTML>

3) Inline

You can define style in html tag only.

<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>

Login/Register to Answer

Related Questions