what is CSS & How to insert CSS

what is CSS & How to insert CSS?. If You Find The Answer Of This Question Then This Article Is Definitely For You. In This Article, We Will Discuss what is CSS, the History of CSS, Variations in CSS & How to insert CSS. So Without Wasting Time Let’s Know About The CSS.

what is CSS

Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the look and formatting) of a document written in a markup language.
  I’s most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG, and XUL A CSS (cascading style sheet) file allows to separate a web sites  (X) HTML content from its style. 

CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the fonts, colors, background, borders, text formatting, link effects & so on.). 

This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content such as by allowing for tableless web design. 

CSS can also allow the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser or screen reader), and on Braille-based,  tactile devices. 

It can also be used to allow the web page to display differently depending on the screen size or device on which it is being viewed.  While the author of a document typically links that document to a CSS style sheet, readers can use a different style sheet, perhaps one on their own computer, to override the one the author has specified. 

CSS specifies a priority scheme to determine which style rules apply if more than one rule matches a particular element.  In this so-called cascade, priorities or weights are calculated and assigned to rules, so that the results are predictable.  The CSS specifications are maintained by the World Wide Web Consortium (W3C).  Internet media type (MIME type) text / CSS is registered for use with CSS by RFC 2318 (March 1998).

A style sheet is made up of style rules that tell a browser how to present a document.  There are various ways of linking these style rules to your HTML.  documents, but the simplest method for starting out is to use HTML’s STYLE element.  This element is placed in the document HEAD, and it contains the style rules for the page.

History of CSS

Style sheets have existed in one form or another since the beginnings of SGML in the 1970s. Cascading Style Sheets were developed as a means for creating a consistent approach to providing style information for web documents.

As HTML grew, it came to encompass a wider variety of stylistic capabilities to meet the demands of web developers.  This evolution gave the designer more control over site appearance but at the cost of HTML becoming more complex to write and maintain. 

Variations in web browser implementations, such as Violawww and World Wide Web, made consistent appearance difficult, and users had less control over how web content was displayed.  Robert Cailliau wanted to separate the structure from the presentation. 

The ideal way would be to give the user different options and transferring three different kinds of style sheets: one for printing, one for the presentation on the screen, and one for the editor feature.

 Variations in CSS

CSS has various levels and profiles.  Each level of CSS builds upon the last, typically adding new features and typically denoted as CSS1, CSS2, CSS3, and CSS4.  Profiles are typically a subset of one or more levels of CSS built for a particular device or user interface. 

Currently there are profiles for mobile devices, printers, and television sets.  Profiles should not be confused with media types, which were added in CSS2.

(a) CSS1: The first CSS specification to become an official W3C Recommendation is CSS level 1. Published in December 1996. Among its capabilities are supported for 

• Font properties such as typeface and emphasis 
• Color of text, backgrounds, and other elements 
• Text attributes such as spacing between words, letters, and lines of text.  
• Alignment of text, images, tables, and other elements.  
• Margin, border.  padding, and positioning for most elements 
• Unique identification and generic classification of groups of attributes

 The W3C no longer maintains the CSSI recommendation.

(b) CSS2: CSS level 2 specification was developed by the W3C and published as a Recommendation in May 1998. A superset of CSS1, CSS2  includes a number of new capabilities like absolute, relative, and fixed positioning of elements and z – index, the concept of media types support for aural style sheets, and bidirectional text, and new font properties such as shadows.
The W3C no longer maintains the CSS2 recommendation.

(c)  CSS 2.1: CSS level 2 revision 1, often referred to as “CSS 2.1” , Fixes errors in CSS 2, removes poorly supported or not fully interoperable features, and adds already – implemented browser extensions to the specification. In order to comply with the W3C Process for standardizing technical specifications, CSS 2.1 went to Proposed Recommendation on 12 April 2011. After being reviewed by W3C Advisory Committee, it was finally published as a W3C Recommendation on 7 June 2011

(d) CSS3: unlike CSS2 a large single specification defining various features CSS3 is divided into several separate documents called “modules”.  Each module adds a new capability or extends features defined in CSS2.  over preserving backward compatibility.  Work on CSS level 3 started around the time of publication of the original CSS2 recommendation. 

The earliest CSS3 drafts were published in June 1999, Due to the modularization, different modules have different stability and are indifferent status. As of November 2011, there are over fifty CSS modules published from the CSS Working Group Three of them Selectors, Namespaces and Color  “became W3C Recommendation in 2011.

some modules such as Backgrounds and Colors, Media Queries, Multi-column Layout are in the candidate Recommendation status and considered moderately stable. At this stage. Implementation are advised to drop vendor prefixes.

How to insert CSS

When a browser reads a style sheet, it will format the document according to it.
There are three ways of inserting a style sheet

• External style sheet 
• Internal style sheet 
• Inline style

(a) External style sheet:
An external style sheet is ideal when  the style is applied to many pages. With an external style sheet, you can change the look of an entire web site by changing one file. Each page must link to the style sheet using the <link> tag.  The <link> tag goes inside the head section:

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

An external style sheet can be written in any text editor.  The file should not contain any HTML tags.  The style sheet should be saved with a .css extension.  An example of a style sheet file is shown below:
hr {color: sienna ;}
P {margin – left: 20px ;}
body {background-image:url (“images / back40.gif”);}

Do not leave spaces between the property value and  the units! “margin – left: 20 px” (instead of “margin – left: 20px”) will work in IE, but not in Firefox or Opera.

(b) Internal Style Sheet:
An internal style sheet should be used when a single document has a unique style.  Internal styles can be defined in the head section of an HTML page by using the <style> tag, like this:
<style type = “text / css”>
hr {color:sienna;}
p {margin – left: 20px;}
body {background – image: url (“images / back40.gif”); }

(c) Inline Styles:
 An inline style loses many of the advantages of style sheets by mixing content with presentation.  Use this method sparingly!  To use inline styles you use the style attribute in the relevant tag.  The style attribute can contain any CSS property.  The example shows how to change the color and the left margin of a paragraph:
<p style = “color: sienna; margin-left: 20px”> HELLO WORLD.  </p>


This Is Our what is CSS & How to insert CSS? I Hope You Find Your Answer About CSS. If You Have Any Suggestions Or Questions Related To This Article, Then Definitely Tell In The Comment, We Will Reply To You As Soon As Possible.
Source: I&WT, Wikipedia
Our Suggested Article’s
What To Do If Mobile Is Stolen??
How To Choose Best Mobile Camera
How To Choose Best Processor For Mobile??
Best Top Ten Printers For Home & Office Use In 2020
How To Send Stickers In WhatsApp??
What Is Domain Name Servers?What Is Ip Address?? And Ip Address ClassesWhat Is A Modem? & Types Of ModemBest Wireless Earphones Under Rs 2000 -Tested & ReviewedConnecting To The Internet In Windows PcWhat Is Internet Definition And Evolution Of The Internet
Ten Best Bluetooth Earphones Under 1000 Rupees -Tested & ReviewedTen Best Wireless Mouse Under 1000 Rupees – Tested & ReviewedThe Best Mouse Under 500 Rupees – Tested And ReviewedBest Wireless Mouse Under 500 Rupees – Tested And Reviewed

3 thoughts on “what is CSS & How to insert CSS”

  1. Especially enlightening look forwards to coming back again. Nalani Kristoffer Gustave

  2. Thank you for the information. Great job. I spent the last 20min having a good read of your content. Thalia Eddie Oren

  3. There is definately a lot to know about this topic. I like all the points you made. Helaina Elihu Davies


Leave a Comment