Style sheet language used to describe the look and formatting of a document written in markup language. Style sheets are powerful way for adding styles in web documents. Style sheet give us a greater control over the presentation of web document. It provides more flexibility and reduces complexity.
Syntax:
Item {property: value};
There are three types of style sheet files:
1. Inline style sheet
2. Internal style sheet or Embedded style sheet
3. External style sheet
1. Inline style sheet - In the In-line style, the type style is defined within the body of the HTML document itself. E.g. in the paragraph tag <p> we can specify the style as follows:
<h1 style=”font: “Arial” 18px>
Vaishnoo Maa Computers
</h1>
2. Internal style sheet - A style sheet can be fully defined in header section with the <style> and </style> tags. This way of defining style sheet is called an internal style sheet.
<head>
<title>CGS</title>
<style>
Body {font: 14px; color: black; background:orange}
P {font: 12pt”times roman”}
H4 {font: 26pt”times roman”}
</style>
</head>
3. External style sheets - In case of an external style sheet, it is stored in a separate file. This style sheet can be linked to any number of HTML documents. We use <link> tag in header section to link a external style sheet to HTML document.
<head>
<LINK rel="stylesheet" type="text/css" href="exstyle.css" title="style1">
</head>
Consider the style sheet “exstyle.css”, which is shown below
Body {font: 14px”arial”; color: black;}
H1 {font: 12pt”times roman” bold}
A {text-decorator: blinking; color: green}
No comments:
Post a Comment