Saturday, July 6, 2013

What is CSS? Lesson #2

Embedded CSS - The <style> Element: CSS # 2
You can place CSS embedded in  head section


<head>
<style type="text/css" media="screen">
Style Rules
............
</style>
</head>


type="text/css"
Specifies the style sheet language as a content-type (MIME type).

media="screen"
Specify the device that would display the document.
Default value is all. This is optional attribute.

options =tty, tv, projection, handheld, print, braille,aural, all

CSS Overriding Rules :
The CSS defined in external style sheet file takes lowest priority.
CSS defined in <style>...</style> tags will override any external style sheet.
The inline styles takes highest priority and override other <style>...</style> tags or external styles.

CSS Measurement Units
% measurement as a percentage of enclosing element.

p {font-size: 16pt; line-height: 125%;}

cm measurement in centimeters.

div {margin-bottom: 2cm;}

em relative measurement for the height of a font in em spaces.
if you assign a font to 12pt, each "em" unit would be 12pt;
thus, 2em would be 24pt.

p {letter-spacing: 7em;}

pc measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas per inch.

p {font-size: 20pc;}


pt measurement in points. A point is defined as 1/72nd of an inch.
body {font-size: 18pt;}

px measurement in screen pixels.

p {padding: 25px;}

No comments:

Post a Comment