CSS (Cascading style sheets)

Debugging using Javascript

CSS(Cascading style sheets) is a mechanism to add style to a web page to create a style sheet, create a file with the .css extension


To include an external stylesheet, use the <link rel="stylesheet" href="gaurav.css" type="text/css"/> To include an internal stylesheet , use the <style type="text/css"></style> inside the head element.
To style an HTML element directly, use inline styling to specify all the CSS properties in the style attribute.
!important is used to override the previous value of the selector

Points to remember

The class is included by using "." prefix to a class name atribute.
The id selector is included selector is iccluded by using by "#" prefix to a id name attribute
To apply styling to all,

elements having class = "first", use p.first {}
To apply styling to all elements having class="first", use
.first{}
To apply styling to all

having id = "first"
p#first{}
To apply styling to all elements having id = "first", use #first{}
Some examples:
span { text-decoration: underline; }
The above CSS code snippet will add a underline to all text writen inside all <span> elements

  
   table {
   		border:1px solid black;
   		font-weight:bold;
   }
   
   

The above CSS code snippet will add a border of width 1px solid type and black in colour.
The data in the table will be displayed in bold format.

Comments

Popular posts from this blog

Parallel Database design, query processing

Laravel | PHP | Basics | Part 2

Apache Hadoop | Running MapReduce Jobs