CSS Definition
Stands for "Cascading Style Sheet." Cascading style sheets are used to format the layout of Web pages. They can be used to define text styles, table sizes, and other aspects of web pages that previously could only be defined in a page's HTML.
CSS can be added to HTML elements in 3 way:
- Inline - by using the style attribute in HTML elements.
- Internal - by using a <style> element in the <head> section.
- External - by using an external css file.
Inline
An inline CSS is used to apply a unique style to a single HTML element.
An inline CSS uses the style attribute of an HTML element.
<html>
<body>
<h1 style="color:navy;"> Inline </h1>
</body>
</html>
Internal
An internal CSS is used to define a style for a single HTML page. An internal CSS is defined in the <head> section of an HTML page,
within a style element:
<html>
<head>
<style>
body{background-color:blue;}
</style>
</head>
<body>
Internal
</body>
</html>
External
An external style sheet is used to define the style for many HTML pages.
With an external style sheet, you can change the look of an entire web site,
by changing one file!
To use an external style sheet, add a link to it in the <head> section of the HTML page:
<html>
<head>
<link rel="stylesheet" type="text/css" href="external.css">
</head>
<body>
External
</body>
</html>
external.css
body {
background-color:powerblue;
}
h1, p {
color:red;
font-style:itlalic;
}
Some property
- Background color :- {background-color:red;}
- Color :- {color:blue;}
- Font style :- {font-style:italic;}
- Font weight :- {font-weight:bold;}
- Font family :- {font-famil:courier;}
- Text decoration :- {text-decoration:overline;}
- Text transform :- {text-transform:uppercase;}
- Background image :- {background-image:url(apple.jpg)}
- Border style :- {border-style:dotted;}
- Opacity :- {opacity:0.5;}
Property Values
- Font style
- Italic
- Oblique
- Initial
- Inherit
- Weight
- Bold
- family
- Arial
- Times new roman
- Helvetica
- Geneva
- Tahoma
- Decoration
- Overline
- Line-through
- Underline
- Transform
- Uppercase
- Lowercase
- Border style
- Solid
- Dotted
- Dashed
- Double
- Groove
- Ridge
- Inset
- Outset
- opacity
- 0.1 - 1.0
No comments:
Post a Comment