Saturday, 8 April 2017

Using way of CSS


1-inline css
The style attribute can contain any CSS property
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>
2-internal css
<head>
<style type="text/css">
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>
3-external css
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
style sheet file is shown below:

hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Handling Old Browsers
There are still many old browsers who do not support CSS. So ,we should take care while writing our Embedded CSS in an HTML document. The following snippet shows how
To use comment tags to hide CSS from older browsers:
<style
type="text/css">
<!--
body, td {
color: blue;
}
-->
</style>
/*.....this is a comment in style sheet.....*/

No comments:

Post a Comment

Please write your view and suggestion....