CSS Summary

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Web Designing Courses » CSS » CSS Advanced »

CSS (Cascading style sheets) are used to separate content from presentation. CSS describe the presentation of a document written most of the times in HTML. CSS is used to define colors, fonts and layout.

A style sheet file consists of a list of rules.
one or more comma-separated selectors

declaration block (a list of semicolon-separated declarations in curly braces)

<>In CSS, selectors are used to declare which elements a style applies to, a kind of match expression. Here are some examples of selector syntax:

<>
All Elements: that is, using the * selector.
<>By element name: e.g. for all p or h2 elements .

Descendants: e.g. for a elements that are descendants of li elements (e.g links inside lists) the selector is li a.

Class or id attributes: e.g. .class and/or #id for elements with class=”class” or id=”id”.

<>Adjacent elements: e.g. for all p elements preceded by h2 elements, the selector would be h2 + p.
<>Direct child element: e.g. for all span elements inside p, but no span elements deeper within the hierarchy, the selector would be< p > span.

By attribute: e.g. for all <input type=”text”> the selector would be input[type=”text”].

<> Each declaration consists of a property, a colon : and a value.

Example:

p {

font-family: “Arial”erif;

}

h2 {

font-size: 50%;

color: green;

background: white;
}

To use a CSS style sheet created a file with the sytle sheet file with the rules and link it or import it using:

<link rel=”stylesheet” href=”text.css” type=”text/css” >
<style type=”text/css”> @import “text.css”</style> <>


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com