Working with Internal CSS
October 22, 2009 CSS Tutorials
You can use CSS internally with 2 ways
Embedding a Style
Style sheet information can be placed in the HTML file itself. . You define internal styles in the head section by using the <style> tag, like this :
<head>
<style type=”text/css”>
<!–
font {color: navy}
body {background-image: url(”images/bg.gif”)}
h1 {color:red}
–>
</style>
</head>
Multiple Style Sheets
You can apply styles for the same selector in differnt stylesheets. For example:
h1
{
color: blue;
text-align: center;
font-size: 14px
}
Inline style
Style can also be specified on a per HTML element basis, Inline styles are not suitable for HTML documents because using inline styles, css code is mixed up with html code. Below is an example of inline style sheet.
<h1 STYLE=”font-size:14px”>This is inline style sheet.</P>
