General CSS syntax

May 31st, 2009

CSS properties base on the following general syntax:

HTML element (in which the property is to be used) (Self-term1: value; Self-term2: value;)

All properties of an element are, therefore, in a curly brackets (()) and are indicated by a semicolon (;) separated. For each property there is the property, first, then a colon (:) and then the value of the property. An example:

p { font-family:Arial; }

This property applies to the p tag in HTML which is the property of font family and has a value of Arial. Therefore, all p tags with the font Arial written.

Selectors

Selectors in CSS to specify the element for which a claim is valid CSS. A selector is the what in a CSS specification before the bracket is curved. In this case, the relevant HTML elements can be easily separated by commas in a row set. An example:

p,div,ol,ul { color:#000000; }

In this example, the black font color, for all p, div, ol and ul elements.

Often one would like to achieve exactly the opposite: A property is only for the subset of an HTML element application. For instance, only a portion of all p-paragraphs should be a blue font color. In this case there are 2 options: You can have classes or ID’s form. Of course, you can also direct the element with a style but once this formatting is used, it will be useful every time they do not re-specify them.

Specifying the media type in CSS

May 27th, 2009

CSS information can be used for various media types. The different media types are: Normal screen output, screen output to projectors, etc. projection printing Issue on PDAs and other devices with small screen handheld output, to text with fixed character width, such as telex or text – tty output to TV sets tv voice aural output Braille displays braille output for braille printer embossed and all types of media all.

The different media types are using the attribute media determined. This can look like this:

<link rel=”stylesheet” type=”text/css” href=”druck.css” media=”print”>

In this example, the file druck.css serves only as a layout when the browser from a pressure initiated. The output of the information in druck.css is not affected.

NOTE: Even when using multiple media types at once (which is possible in principle) Netscape 4 ignores the CSS. Several types of media, for example, can be specified as:

<link rel=”stylesheet” type=”text/css” href=”standard.css” media=”screen,projection”>

The CSS file standard.css applies in this example, both to the normal screen output as well as the projection (e.g. with beamers). The media projection of Opera is also used for this in full screen mode (with the hidden menu).

Other different types of specifications of media types

They can also be specified when a Style within the head of an HTML file is used:

<style type=”text/css” media=”handheld”>

</style>

Although within a Style range again CSS files are included, media types can be specified:

@import url(druck.css) print, embossed;

In this case, the CSS file druck.css for both the normal pressure, as well as for special Braille Printer. On the specifics of the interpretation of the media types by Netscape 4, I have already received. Netscape 6.1 sees the print, The MS Internet Explorer interprets at least part of the information.

Introduction to Cascading Style Sheets (CSS)

May 25th, 2009

The CSS course includes a basic HTML knowledge. This article explains how CSS and HTML can be combined.

Possibilities of integrating CSS

Basically there are 3 ways to HTML CSS involved directly in a HTML tag in the head section of a site or in an external file. Therefore, this is unique when it comes to the format (directly in the day), file format (in the head of an HTML file) or project-wide format (separate CSS file). The tendency is (and this is also my personal recommendation) to ascribe styles into a separate file. This gives you additional possibilities, such as browser-based CSS use (through a browser), or the user’s choice among several CSS files (the user himself can choose between several designs ).