CSS Basic Idea - will share what i know!!!

Started by Kalyan, May 24, 2009, 11:44 PM

Previous topic - Next topic

Kalyan

Set the background color Using CSS

The below code shows that how to use the CSS in HTML..

if you copy this code and paste in notepad and save it as .htm or .html else use microsoft frontpage...

and aside to css : if use the code <style type="text/css"> which is an internal css and for if you copy the

code in the header tag ans save it in the name of  xyz.css and call in the web like

<link rel="stylesheet" type="text/css" href="xyz.css" /> its an external css


<html>
<head>
<style type="text/css">
body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
p {background-color: rgb(250,0,255)}
</style>
</head>

<body>

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<p>This is a paragraph.</p>

</body>
</html>