Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Monday 22 October 2018

General format of CSS | Syntax of CSS | Syntax and Golden rules of styles in CSS - OnlineHelp

The general format of CSS:

Let's discuss the general format of CSS.

The general format CSS contains two parts in style rule i.e. selector and property: value. The selector determines what HTML tag we are styling, and the declaration is made up of one or more property: value pairs, ending in a semi-colon and enclosed in curly brackets.

In this case, a property is a display feature such as color and value is what we want that property to look like.

 selector{property:value}
 selector{property:value;property:value;property:value;...........}

Where,

selector  : Normal HTML element/tag you wish to define. It is the link between the HTML document and the style sheet.

property: 
The attribute of the tag intended to change.

Example:
1.body{color:green}
In this color attribute of the body, the element is set to green.

2.body{font-family: Arial; color:green}


Read: What is the cascading style sheet

The golden rules for CSS:

 Here are 6 rules of style definitions:


  •  Every CSS definition has to have a selector and a declaration. The declaration follows the selector and uses curly braces.
  • The declaration consists of one or more properties separated with a semicolon.
  •  Every property has a name, colon, and value.
  • A property can have multiple values separated with a comma.
  • Along with value, can also be a unit of measure.No space is allowed between the value and the unit.
  • When writing CSS code, you can use white space as needed-new lines, spaces, whatever makes your code more readable.


Sunday 21 October 2018

What is cascading style sheet | what is CSS - Online Help

Let's discuss what is cascading style sheet?

Cascading style sheets were introduced to provide a uniform and consistent way to specify presentation details in XHTML documents. The CSS1 specification was developed in 1996 by W3C. CSS2 was released in 1998 which added many properties and values to CSS1.

CSS3 has been under development since the late 1990s. CSS provides the means to control and change the presentation of HTML documents. CSS is not technically HTML,but can be embedded in HTML documents.

As we know, the Cascading style sheet was introduced to provide a uniform and consistent way to specify presentation details in X HTML documents.

Most of the style tags and attributes are those deprecated from HTML 4.0 in favor of style sheets. The idea of style sheets is not a new concept as it existed in desktop publishing systems and word processors. Style sheets allow you to impose a standard style on a whole collection of documents.


Also read: what is HTML

Introduction of Style Sheet:


A style sheet is a document that contains style information about one or more documents written in markup languages. It enables us to control the rendering of styles such as font, color, typeface, size, spacing, margins and other aspects of document style.

A style sheet is composed of a set of style rules written in a specified format. This set of style rules instructs browsers on how to present a document on the screen.

 Cascading style sheet:


A cascading style sheet is a style sheet language used to describe the presentation semantics i.e. the look and formatting of the document written in a markup language.

CSS is designed primarily to enable the separation of the document content written in HTML or a similar markup language from document presentation, including elements such as the color, fonts, and layout.

An advantage of CSS:


The following are the advantage of CSS:

1. CSS is to separate document presentation from document content written in a markup language.

2. CSS will allow the designer to create tighter, more dynamic content for the web.

3. Web pages using CSS will transfer faster to users and will be easy to maintain.

4. CSS will lead to improved accessibility, maintainability, and performance on the web.