Quick look-up about how to integrate CSS with a website.
We can write CSS coding inline with HTML or keep it as a separate file.
Here how we can use it as separate CSS file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Web Site TItle</title>
</head>
<body>
Web Site Content Will goes here...
</body>
</html>
In above example you can see style sheet linked to the web page as a external file. Now you can write CSS rules in external CSS file.
Here how we can use it inline with HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
All the style (CSS) Will goes here...
</style>
<title>Web Site TItle</title>
</head>
<body>
Web Site Content Will goes here...
</body>
</html>
Above example you can see tag called 'style'. Between these tags you can use your CSS coding on web page. Also there are another way you can use inline CSS. It is write style codes inside of tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web Site TItle</title>
</head>
<body>
<div style="color:#000;">Web Site Content Will goes here...</div>
</body>
</html>
In above example code CSS styles are written inside of style tag of div elements.
Wednesday, January 11, 2012
Using CSS in a HTML code - Integrate CSS with a Website
3:47 PM
dpk
No comments
0 comments:
Post a Comment