CSS-Definition{...} XHTML (Tag-Attribut) | | #xyz {...} <tag id="xyz" ... .xyz {...} <tag class="xyz" ... tag {...} <tag ... >
(1) | | (2) | | | (3) | | | | | h1 { background: snow; } ————————————————— | | (4)
<!-- im HTML-Body-Tag --> <h1 id="title center"> Titel der Seite </h1> <p class="absatz"> Mein Ansatz </p> <!-- im HTML-Header-Tag --> <style> .title { } .center { text-align: center;} #absatz { color: #ff0; } </style>
body { margin: 20px 10px 5px 10px; }
body { margin-top: 20px; margin-right: 10px; margin-bottom: 5px; margin-left: 10px; }
<div id="DIV"> <p> A <span> B </span> <span> C <span> D </span> </span> E </p> </div>
div { background-color: gray; color: blue;} div > p span { color: green; } div p > span { color: red; }
A B C D E
div { background-color: gray; color: blue;} div span { color: green; } div span ~ span { color: red; }
function $(sel, par) { return (par || document).querySelectorAll(sel); } function set_cssAll(nodes, arr) { var i; for (i=0; i < nodes.length; i+=1) { nodes[i].style.cssText = arr[i] || arr[0];} } set_cssAll($("#DIV"),["background-color: gray; color: blue;"]); set_cssAll($("#DIV > p span"),["color: green;"]); set_cssAll($("#DIV p > span"),["color: red;"]);
x-loud dem Wert 100, loud dem Wert 75, medium dem Wert 50, soft dem Wert 25, x-soft dem Wert 0 und ebenso silent dem Wert 0 entspricht.
<meta name="viewport" content=" height = [pixel_value | device-height] , width = [pixel_value | device-width ] , initial-scale = float_value , minimum-scale = float_value , maximum-scale = float_value , user-scalable = [yes | no] , target-densitydpi = [dpi_value | device-dpi | high-dpi | medium-dpi | low-dpi] " />
@viewport { zoom: 1.0; width: auto; }
@viewport { width: 480px; zoom: 2.0; user-zoom: zoom; }
@viewport { width: 980px; min-zoom: 0.25; max-zoom: 5; }