<< Chapter < Page Chapter >> Page >
The module presents the concepts used in the CSS programming language.

Introduction

Cascading Style Sheets (abbreviated CSS) are used to describe how (X)HTML or XML text is to be presented. This module is currently a commented link list of important entry points for reading about CSS.

This module gives a simple example how a CSS style sheet works.

Content of this module

Css rules

A CSS file consists of statements which are either at-rules or rule sets (often just called rules). A rule set (rule) consists of a selector and a declaration block which contains one or more declarations (more see CSS 2.1 specification ). A declaration contains a property and a value (e.g. "color" and "green"), see example below. These rules describe how the formatting should take place.

Below are some sample rules. In the first part one or several selectors are given and in the second part there are one or more attribute-value pairs enclosed by curly brackets.

/* Sample rules */ h1, h2 {color: green}#box {width: 70%} .topic {color: red}

    Selector types

  • h1 and h2 are tag selectors
  • #box is a selector for an identification
  • .topic is a selector for a class

A series of tests for selectors.

Internal and external style sheets

A style sheet may reside in a separate file ( external style sheet ) or within an (X)HTML file ( internal style sheet ).

External style sheet

<head><link rel="stylesheet" type="text/css" media="screen, projection, handheld, print" href="css/general.css" /><link rel="stylesheet" type="text/css" media="print" href="css/ourPrintStyleSheet.css" /></head>

In the case of the code above taken from a HTML file we load a general style sheet for different kinds of output media called general.css and a specific one for printing ( ourPrintStyleSheet.css ). The style sheet for printing adds and overrides some rules to put the content onto paper.

Internal stylesheet (html)

<style type="text/css">h1 { color: green;}</style>

Internal stylesheet (xhtml)

<style type="text/css"><![CDATA[ h1 {color: green; }]]></style>

@import rule

The @import rule ( ref. ) allows you to import rules from another style sheet into your current one. For an example see ´web fonts´ below.

Reference

CSS 2.1 specification (implemented by most browsers); an index

All W3C CSS standards and drafts

The link above includes the documents commonly called CSS 3 which consists of different modules. They are implemented to various degrees in the current browsers.

Tutorial

w3.org: Starting with HTML and CSS (basic introduction)

Complete course with interactive exercises w3schools

Searching for the key words css cheat sheet provides helpful links if you have learned CSS in the past. This brings up for example this list which leads to 30 examples .

Layout with css

For doing layout with CSS the 'position' attribute and the box model are used. In the past this was difficult because the box model implemented by the Internet Explorer (IE) differed from the web standard and from the box model implemented by other browsers. In the meantime the Internet Explorer supports the standard W3C box model so using CSS in modern browsers is made easier as there needs not to be a 'switch' anymore for IE and the other browsers. CSS 3 introduces the box-sizing property which allows to set how the box size is calculated ( (External Link) ).

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Test collection revision. OpenStax CNX. May 02, 2012 Download for free at https://legacy.cnx.org/content/col11421/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Test collection revision' conversation and receive update notifications?

Ask