Css Presentation
Css Presentation
Linking to Style Sheets. There are several ways you can do depending on
what you need to do. Following are methods used for linking in or adding
styles.
1.Link to an external style sheet from your HTML document
2.Embed a style sheet within your HTML document
3.Add styles in line with your HTML document
4.Import one style sheets into another style sheets
1. Link to an external style sheet from your HTML document. Catering all styles
in a separate text file and store it in your HTML pages. Save your style sheet
files with .css extension and link it under the <HEAD> tag using <LINK> tag.
<HEAD>
<LINK REL=stylesheet href=“style1.css” type=“text/css”>
</HEAD>
<HTML>
<HEAD>
<style text=“text/css”>
<!-- body { background : white; font-family: helvetica }
p i { font-size: 14pt }
-->
</style>
</HEAD>
</HTML>
3. Add styles in line with your HTML document. You use the same
style <STYLE> tag with embedded styles, but you put it within the
declaration of the tag.
4. Import one style sheets into another style sheets. Add the import
statement in the file.
A. Background Color
body {background-color:#b0c4de;}
The background color can be specified by:
name - a color name, like "red"
RGB - an RGB value, like "rgb(255,0,0)"
Hex - a hex value, like "#ff0000"
B. Background Image
body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
II.3 FONTS
CSS Font Families
In CSS, there are two types of font family names:
generic family - a group of font families with a
Roman" or "Arial")
Generic Family Font Family Description
Serif Times New Roman Serif fonts have
Georgia small lines at the
ends on some
characters
EX: Ai
Sans-serif "Sans" means
without - these
Arial
fonts do not have
Verdana
the lines at the ends
of characters
EX: Ai
Note: If the name of a font family is more than one
word, it must be in quotation marks, like font-
family: "Times New Roman".
Ex:
p{font-family:"Times New Roman", Times, serif;}
Font Style
p.normal {font-style:normal;}
p.italic {font-style:italic;}
p.oblique {font-style:oblique;}
Font Size
Always use the proper HTML tags, like <h1> -
<h6> for headings and <p> for paragraphs.
h1 {font-size:40px;}
h2 {font-size:30px;}
p {font-size:14px;}
II.4 Styling Links
EX:
a:link {color:#FF0000;} /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
<H1 id=“74p”>Maroon</H1>
<P> and more about colors here <B id=74p>maroon</B>.</P>
Thank YOU!
Hope you enjoy reading my presentation…