Type of Style Sheets

December 29, 2006 at 6:50 am | In CSS, Tech | 3 Comments

Style sheet can be included in HTML document in 3 ways,namely

1.External Style Sheets.
2.Internal Style Sheets.
3.Inline Styles.

External Style sheets

In External Style Sheets , the styles are stored in a separate file and then that file is included in the HTML Page. You might be wondering what are styles(will be seen later), but for now just assume that each tag comes with styles. The external file(in which styles are stored) should be saved with the extension .css. Then that CSS file should be included in the HTML page using the <LINK> tag.

Example :

<head>
<link rel=”stylesheet” type=”text/css”
href=”mystyle.css” />
</head>

Explanation for the example :

rel = “stylesheet” tells that the relation of the link is stylesheet.rel can also be assigned to copyright,content,chapters etc.

type tells the type of link . text/css says stylesheet. type can also be assigned to text/javascript,text/vbscript etc.

href tells the path of the css file.If its in the same folder as that of HTML page then it is enough t0 give the name of the CSS file along

with the extension.If its in different folder other than the folder in which the HTML page is , then the relative path should be given . For example href =”../[stylesheet folder name]/[filename].css”

Note :

1.The LINK tag should be used in the <HEAD> tag.

Internal Style Sheets

In Internal Stylesheets , the styles for the tags are specified in the head section itself using the style tag. styles are not stored in a separate file.

Example :

<head>
<style type=”text/css”>
hr {color: sienna}
p {margin-left: 20px}
body {background-image: url(“images/back40.gif”)}
</style>
</head>

Explanation for the example :

type tells the type of link . text/css says stylesheet. type can also be assigned to text/javascript,text/vbscript etc.

hr {color: sienna} tells that any hr tag used should have the color sienna. Similarly we can set the syles for the other tags.

Note :

1.The STYLE tag should be used in the <HEAD> tag.

Inline Styles

In case of Inline Style Sheets the styles for the specific tags are given in the tag itself using the style attribute.

Example :

<p style=”color: sienna; margin-left: 20px”>
This is a paragraph
</p>

Explanation for the example :

style=”color: sienna; margin-left: 20px” specifies that this <p> tag should use color as sienna and left margin should be 20 px.

Priority of the Styles :

1.Inline styles.
2.Internal Style Sheets.
3.External Style Sheets.
4.Browser Default Styles.

In order to avoid conflict of styles used the above priority is followed.

Note:
1. We see that the fourth priority if for the Browser defaults. Thats why we see that different browsers render differently(Each Browser uses its own default style)

Standards :

Its better to use External Style Sheets that Internal and Inline because to use common styles across multiple pages the same Style Sheet can be used . But thats not always the case . When you want to apply a particular style specific for a portion of the page Inline or Internal will be preferred.

How to Use On-Screen KeyBoard

December 29, 2006 at 6:01 am | In Education, Tech, Tips and Tricks in XP | 4 Comments

Want to use an on screen keyboard? Well it is this simple – Click on the start button and select run. Then type in osk in the box and click OK.A KeyBoard appears which you can use with mouse.

How to turn CD Autorun off

December 29, 2006 at 5:19 am | In Tips and Tricks in XP | Leave a Comment

1) Click Start, Run and enter GPEDIT.MSC

2) Go to Computer Configuration, Administrative Templates, System.

3) Locate the entry for Turn autoplay off and modify it as you desire.

How to make folder private

December 29, 2006 at 4:58 am | In Education, Tech | 1 Comment

•Open My Computer
•Double-click the drive where Windows is installed (usually drive (C:), unless you have more than one drive on your computer).
•If the contents of the drive are hidden, under System Tasks, click Show the contents of this drive.
•Double-click the Documents and Settings folder.
•Double-click your user folder.
•Right-click any folder in your user profile, and then click Properties.
•On the Sharing tab, select the Make this folder private so that only I have access to it check box.

Note:

•To open My Computer, click Start, and then click My Computer.
•This option is only available for folders included in your user profile. Folders in your user profile include My Documents and its subfolders, Desktop, Start Menu, Cookies, and Favorites. If you do not make these folders private, they are available to everyone who uses your computer.
•When you make a folder private, all of its subfolders are private as well. For example, when you make My Documents private, you also make My Music and My Pictures private. When you share a folder, you also share all of its subfolders unless you make them private.
*You cannot make your folders private if your drive is not formatted as NTFS.

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.