How to use it css
Three Ways to Insert CSS
- External style sheet
- Internal style sheet
- Inline style
External Style Sheet
With an external style sheet, you can change the look of a whole site by changing only one document!Each page must incorporate a reference to the external style sheet document inside the <link> component. The <link> component goes inside the <head> segment:
Example
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
href="mystyle.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Internal Style Sheet
An internal style sheet might be utilized on the off chance that one single page has a special style.Internal styles are characterized inside the <style> component, inside the <head> area of a HTML page:
Example
<head>
<style>
body {
background-color: linen;}
h1 {
color: maroon;
margin-left: 40px;}
</style>
</head>
Inline Styles
An inline style might be utilized to apply an interesting style for a single element.To utilize inline styles, add the style ascribe to the pertinent element. The style trait can contain any CSS property.
The case beneath demonstrates to change the shading and the left edge of a <h1> element:
Example
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
0 comments:
Post a Comment