HOME
            About US
            Contact Us
            Book     Book Preface

What is CSS

1.3 - Basic Web Page (What is CSS):(page 4/5)    


(Cotinued from previous page)
1.3.2- Construction of Style Sheet:
This file is known as Cascading Style Sheets with '.css' extension. This file is used to define the format / layout of the web page. In this file the various elements / segments / divisions, location of a segments, size of segment, font size, color and other decorations / styles are defined.

A web page style can be defined in following 3 ways -

i) External Style Sheet: This is a separate file other than the main HTML file with an extension 'css' (e.g. style.css). This file name is declared in main HTML file. One external style sheet can be linked to one or many web pages. If all your web pages are having same style for all pages, then you can use only one 'Style Sheet', otherwise use different style sheet for different pages. The 'Style Sheet' is linked to HTML file by the following command placed between <head> and </head> tag of HTML.

Command: <link rel='stylesheet' href='style.css' type='text/css' />

You can change 'style.css' with the name of your style sheet having extension '.css'. The style.css is a separate file having style commands.

ii) Internal Style Sheet: If There are very few style to be declared in your web page, then it can be done by writing the 'Style' commands between <head> and </head> tag of HTML and no separate 'style.css' is required.

e.g. If you want to define only the color of page body and color of link tag, then the following command written between <head> and </head> will work.


Command: <style type='text/css'>
body {background-color:yellow;}
a {color: What is CSSE61C1C; text-decoration: none;}
</style>

(Contiued to next page (Pg-5))


css
© funandhobby.com (What is CSS)