Introduction
Cascading Style Sheets, fondly known as CSS, is a honestly designed language meant to simplify the method of creating internet pages presentable. CSS lets in you to use patterns to internet pages. CSS allows you to do that impartial of the HTML that makes up every internet page. CSS is simple to analyze and understand, however it presents effective manage over the presentation of an HTML document.
It offers a further characteristic to HTML. It is usually used with HTML to extrade the fashion of internet pages and person interfaces. It also can be used with any sort of XML files together with undeniable XML, SVG and XUL.
CSS is used along side HTML and JavaScript in maximum web sites to create person interfaces for internet packages and person interfaces for lots cellular packages.
WHY CSS?
Easy Maintenance: To make a worldwide extrade absolutely extrade the style, and all factors in all of the webpages could be up to date automatically.
Search Engines: CSS is taken into consideration a smooth coding technique, because of this that engines like google won`t must warfare to “read” its content.
Superior patterns to HTML: CSS has a far wider array of attributes than HTML, so that you can deliver a much higher appearance for your HTML web page in assessment to HTML attributes.
Offline Browsing: CSS can shop internet programs regionally with the assist of an offline cache. Using this we will view offline websites.
CSS Syntax
A CSS Syntax rule includes a selector, belongings, and its price. The selector factors to the HTML detail wherein CSS fashion is to be applied. The CSS belongings is separated with the aid of using semicolons. It is a mixture of selector call observed with the aid of using the belongings: price pair this is described for the unique selector.
Syntax:
h1 { color: red; font-size: 7px;}
- h1 <- Selector
- color <- Property
- red <- Value
- font-size <- Property
- sans-serif <– Value
Selector: Selector indicates the HTML element you want to style.
Declaration: The declaration can contain one or more declarations part separated by a semicolon.
color: red;
font-size: 7px;
Property: A Property is a type of attribute of HTML element.
Value: Values assigned to CSS properties.
Every assertion has a CSS assets call and a value, separated with the aid of using a colon & is surrounded with the aid of using curly braces. For affirming the a couple of CSS properties, it may be separated with the aid of using the semicolon.
Example
· <html>
· <head>
· <!-- Style of h1 selector -->
· <style>
· j {
· color: red;
· text-align: center;
· }
· </style>
· </head>
· <body>
· <h1>ComputerLanguages</h1>
· </body>
· </html>
OutPut:
ComputerLanguages
CSS Comment:
The Comments in CSS, are the statements on your code which are neglected through the compiler and aren't executed. Comments are used to provide an explanation for the code. They make this system greater readable and understandable.
Syntax:
/* content */
Comment may be unmarried-line or multi-line. The /* */ remark syntax may be used for each unmarried and multiline feedback. We may also use syntax for hiding in CSS for older browsers, however that is not endorsed for use. Adding feedback withinside the code is a superb exercise which could assist to recognize the code if a person reads the code or if it's far reviewed later.
1. Singal Line Comments
/*
Singal Line Comments */
2. Multi- Line Comments
/*
Multi
Line Comments */
0 Comments