Internet publishing cascading style sheets, CSS
Petr Zámostný room: A-72a phone: 4222 e-mail: petr.zamostny@vscht.cz
Internet publishing cascading style sheets, CSS Petr Zmostn room: - - PowerPoint PPT Presentation
Internet publishing cascading style sheets, CSS Petr Zmostn room: A-72a phone: 4222 e-mail: petr.zamostny@vscht.cz Visually perfect" pages Reasons leading to visually "perfect" pages Customer requirements to
Petr Zámostný room: A-72a phone: 4222 e-mail: petr.zamostny@vscht.cz
http: / / www.vscht.cz/ kot/ resources/ studijni-materialy/ ip-p-004/ spatny-priklad.html
http: / / www.vscht.cz/ kot/ resources/ studijni-materialy/ ip-p-004/ lepsi-priklad.html
<head> <style type="text/css"> <!– this line is HTML comment (hides style from ancient browsers ... Style definition ...
</style> </head>
selector { property1: value; property2: value; ... propertyN: value }
Unit Meaning em Corresponds to the font size in current element (corresponds to the font size of parent element if used for setting the font size itself) ex Corresponds to the ‘x’ letter height px pixel – one point in the display device
Unit Meaning in Inch cm Centimeter mm Millimeter pt Typographic point (1 pt = 1/ 72 inch) pc Typographic pica (1 pc = 12 point)
Unit Meaning % Sets size proportionally to another size Reference size is defined for each property that allow percentuals
Rules with the same declarations can be merged into single rule h1 { font-family: sans-serif } h2 { font-family: sans-serif } h3 { font-family: sans-serif } Is equivalent to: h1, h2, h3 { font-family: sans-serif }
Syntax Com m ents color_name Color keyword (red, green, blue, magenta, ...) rgb(x,x,x) RGB components 0-255 rgb(y% , y% , y% ) RGB percentuals 0-100% # rrggbb Hexadecimal RGB components 00-ff
More on cololors
property Description Values font-family Preferred font families family-name generic-family
property Description Values font-family Preferred font families family-name generic-family
property Description Hodnoty font-style Font style normal italic
font-variant Font variant normal small-caps font-weight Font weight (boldness) normal bold bolder lighter 100 200 ... 900
property Descriptions Values font-size Font size xx-small x-small small medium large x-large xx-large smaller larger délková jednotka %
property Description Values color Text color color background-attachment Sets if the background image scrolls with the text or remains static scroll fixed background-color Sets element background color color transparent background-image Image on background of the element, can tile to fill up space url none background-position Alignment of the background image top left top center top right center left center center center right bottom left bottom center bottom right x-% y-% x-pos y-pos background-repeat Tiling of the background image repeat repeat-x repeat-y no-repeat
property Description Values letter-spacing Spaces between letters normal length text-align Vertical alignment of the text left right center justify text-decoration Line ornaments around text none underline
line-through blink text-indent Indentation of the first line of the block element length % text-transform Font case transformation none capitalize uppercase lowercase white-space Interpretation of spaces, tabs, linebreaks normal pre nowrap word-spacing Spaces between letters normal length
Element content padding margin
border
property Description Values Margin Shorthand properties for setting up all margins margin-top margin-right margin-bottom margin-left margin-bottom Bottom margin size auto length % margin-left Left margin size auto length % margin-right Right margin size auto length % margin-top Top margin size auto length %
property Description Values border-color Border color Color border-style Border style none hidden dotted dashed solid double groove ridge inset
border-width Border width (applies even if the border is transparent) thin medium thick length
property Description Values list-style-image Uses specified image as the list bullet character none url list-style-position Bullet position relatively to box content edge inside
list-style-type Bullet/ numbering type none disc circle square decimal decimal-leading-zero lower-roman upper-roman lower-alpha upper-alpha lower-greek lower-latin upper-latin hebrew armenian georgian cjk-ideographic hiragana katakana hiragana-iroha katakana-iroha
<head> <style type="text/css"> p { color: red } </style> </head> <body> <p>Red <em>text<em></p> </body>