Skip to main content

Advantages of using CSS

 

o Time Saver- Writing CSS code saves our time as we can do global changes easily .

o Page loads faster- We are not considered to write HTML tag attributes every time, if we are using CSS. So, less code means our page will load faster.

o Superior styles to HTML- Array of attributes in CSS are wider than HTML, that gives a better look to the page.

 oMaintenance becomes easy- If you want to make a change globally, just change the style and changes will be done in all the web pages.

o Multiple device permittance- CSS allow content to be optimize for various types of devices. It make the pages compatible to different devices and browsers.

 

o How we write code in CSS/Use-

External Style Sheet-   is used when we want to apply style to multiple pages. Each of the pages must link to style sheet by using <link> tag.

Internal Style Sheet- It should be used when we want to style single document. They are defined in head section.

Inline Style Sheet- means style sheets inside the HTML element. It has the highest priority, means it overrides the style attribute written inside the <head> tag.

CSS syntax- is divided into 3 parts i.e. selector, property and value. Selector is basically the HTML element/tag that we want to style and property is the attribute that we want to change.

And the property is given value. The property and value are surrounded by curly braces and separated by a colon (:).

      selector {property:value}

            body {color:yellow}

            h1 {font-family: “Arial”}

 

Different types of selectors-

 

The type selector-

 

h1{

        color #36CFFF;

}

The universal selector

*{

       color #000000;

}

The class selector

.black {

        color #000000;

}

The ID selector

#black {

          color #000000;

}

The child selector

body>p {

    color #000000;

}

The attribute selector

Input[type= “text”]{

    color #000000;

}

 

CSS links- Links can be styled using CSS. Here we have four different link stages -

Ø Link (unvisited )

Ø Visited

Ø Hover

Ø Active ( on which text user is clicking)

Above stages must come in this order as shown above.

<style type= “text/css”>

      a:link{color:blue}

      a:visited{color:green}

      a:hover{color:puple}

      a:active{color:red}

</style>

Comments

Popular posts from this blog

Back-end Development

  Web applications behind the scenes are controlled by Back-End Development. Back-end is used to create Front-end by utilizing a database. Back-end can be written in various coding system and dialects, for example, v php- php document is an ASCII record, made using any ASCII editor (Notepad and Notepad++). Html codes are written in php files and can be easily embedded. v JAVA- JAVA is one of the most liked programming languages. It was developed in early 90’s by sun microsystems. Father of Java is James Gosling and it is high level programming language. v Python- Python language is being utilized at both small and huge scale due its adaptable nature and numerous programming ideal models like object-oriented, imperative, functional and procedural.

History and versions

  - HTML was created by Tim Berners Lee in 1991. He considered it to be an application of SGML (Standard Generalized Markup Language).”HTML 2.0” was published in 1995. “HTML 4.01” was published in 1999. Although “HTML 4.01” version is widely used yet currently “HTML 5” is used more commonly and it was published in 2014.    HTML was originally developed with the intention of evaluating the structure of document like headings, lists, paragraphs etc. to give the facility of sharing information between scholars.   But now, it is being   commonly used for format web-pages .   o How we write code in HTML/Use- HTML is specified as TAGS in an HTML document. HTML Tags- It is basically word or group of words enclosed between Angle Brackets as <html>. Usually, These Tags comes in pair as <h1>   &   </h1> , that are wrapped around some text. They are called Container tags. 1st tag in the pair is opening tag and the 2nd one i...

Cascading Style Sheet

  CSS ( The Stylist ) HTML is responsible for all the core foundation and CSS is responsible designing of webpage like pretty layout, add colors to your font, change the font-size and font-style etc. Both are used together.               Hence we can say that- “It is a language for specifying how documents/web-pages are presented to the user.” By the use of CSS, we can manage what the color of text, style of fonts, background color and images, spaces between the paragraphs, variation in display for different devices and screen size should be, how columns are sized etc. It gives us the control over presentation of the document.   History and versions- It was invented by HakonWium Lie in 1994 and maintained by a group of people within the W3C (World Wide Web Consortium). This group creates docs. called ‘specifications’. After a discussion by W3C members, it becomes a ‘recommendation’. In December 1996, C...