$type=slider$snippet=hide

Description

Description

Work with CSS

2. Document Level Style Sheets:


This way browsers that do not understand the style tags will not display the content between the tags as part of the document. Browsers that do recognize style tags will ignore the HTML comments in the style definitions since they are not using the HTML parser to interpret them, but rather the CSS parser.


CSS comments look like C programming language comments (/* comment */):


<style>
<!--
/* set blockquotes in blue italic */
blockquote {color: blue; font-style: italic}
-->
</style>


The HTML comment tags are the only HTML that should appear in the style sheet. Everything else should be properly formed CSS.


This is wrong, since it has an HTML tag inside it.



<style>
<!--
/* set blockquotes in blue italic */
<blockquote> {color: blue; font-style: italic}
-->
</style>


The <style>  tag should also have a type definition indicating whether it is a CSS style sheet (type="text/css") or a JavaScript style sheet (type="text/javascript") style sheet. We are only going to talk about CSS here, since JavaScript style sheets are specific to older versions of Netscape and Netscape has ceased supporting them.


The type attribute refers to the MIME type of the content. MIME stands for Multipart Internet Mail Extension. It is a standard, which defines how to make systems aware of the type of content being included in e-mail messages.


The primary component of MIME types is a hierarchical labeling system that declares what category of content the document contains and what specific type it is within that category. For instance, a plain text document is of type text/plain and a JPEG image is of type image/jpeg. These types can then be associated programmatically with applications that can read those MIME types.


It has proved to be a useful enough protocol that most applications these days make use of MIME types to determine what sort of document they are trying to read, Any included content that is not of the same MIME type as the main document should have the MIME type specified.


3. External Style Sheets:


External style sheet: a collection of style  rules stored in an external frame and copied  into the document when it is loaded into the  application.


To maintain consistency across a site, you can use external style sheets rather than style sheets internal to you document. You can copy external style sheets into a page when loading, allowing for more dynamic modification of site layouts, as well as standardization across pages. External style sheets are stored in their own text file ending in a .css suffix.


To include an external style sheet into a document, you can either link it to the current document, or you can import it. The @import command is (as of mid-2002) only supported by Internet Explorer, but allows you to import stylesheet rules into a document-level style sheet. The @impotr command is a CSS command and is used inside the CSS code, which is to say between the <style> tags.


<style>
<!--
@import url(styles/general.css);
-->
</style>


The @import command is a CSS command and is used inside the CSS code, which is to say between the style tags.


<style>
<!--
@import url(styles/general.css);
@import url(styles/special_case1.css);
@import url(styles/special_case2.css);
-->
</style>


The benefit of the import tag, when it becomes fully supported, it that it will allow you to create style sheet families. By nesting imported style sheets, you will be able to have imported style sheets import their own style sheets. This means that you will be able to create a style sheet libraries, rather than include duplicate code in multiple style sheets.


It is also useful for dealing with backwards compatibility, where basic styling is put in an inline or external style sheet and then more advanced styling rules that only work in newer browsers is imported in. Thus, only those that understand the @import command will try to import the advanced style rules. When importing, the @import command should occur before all other style rules in the style sheet.

Name

CBSE,1,Essay Writing,7,G.K & Current Affairs,7,Information & Technology,21,Letter Writing,8,News Letter,10,Passage Writing,3,Report Writing,2,SEBA,1,
ltr
static_page
Teacher Notes: Work with CSS
Work with CSS
Teacher Notes
https://www.freeteachernotes.com/p/work-with-css.html
https://www.freeteachernotes.com/
https://www.freeteachernotes.com/
https://www.freeteachernotes.com/p/work-with-css.html
true
2332357964370966229
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy