Rubrik 1
#content {margin:10px; border:5px solid gray; background-color:blue; width:200px; padding:25px;}Lorem ...
Cascading Style Sheets
• Lätt att underhålla • Mindre filstorlekar • Ökad tillgänglighet • Olika media • Större typografisk kontroll
L2
Lorem ipsum ...
h1 { text-align: center; } h2 { font-style: italic; } p { color: maroon;}
• h1 { text-align: center; } • h2 { font-style: italic; } • p { color: maroon;}
@charset "utf-8"; }
h1, h2
{ text-align: center; color:#007FFF;
/*
Färgerna anges som RR GG BB
*/
} h2 { font-style: italic; } p { color: maroon;
} h2 { font-style: italic; font-variant: small-caps; font-weight: bold; font-size: 100%; line-height: 120%; font-family:Arial, Helvetica, sans-serif;
h1 { border-width: 1px; } border-style: dashed; border-color: red;
} p { color: maroon; padding-top: 1em; padding-right: 2em; padding-bottom: 3em; padding-left: 4em; border-width: 1px; border-style: solid; border-color: blue; line-height: 130%;
} p { color: maroon; margin-top: 1em; margin-bottom: 3em; border-width: 1px; border-style: solid; border-color: blue; line-height: 130%;
3 sätt att stila på L4
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
(4a)@charset "utf-8"; { p font-family:Arial, Helvetica, sans-serif; margin:15px; padding:1em; background-color:gray; width:10em; } color:white; { h1 } margin:15px;
L5
Lorem ...
@charset "utf-8"; /* CSS Document */ p {color:black;} p em {color:green;} div p {color:red;} .special{background-color:#999999;
Och här kommer brödtexten
Lorem ipsum …
Ut wisi enim ad minim …
Nam liber tempor
Claritas est etiam.
p {color:black;} p#vanlig{color:blue;} p#vanlig em {color:green;} div p {color:red;} .special{background-color:#999999;} #speciell{background-color:#999900;} h1#first_header {border:dotted} * {color:maroon}
Och här kommer brödtexten
Lorem ipsum dolor …
Ut wisi enim …
Nam liber tempor ….
Claritas est etiam ….
• p:first-letter {font-size:36px} • p:first-line {font-size:24px}
@charset "utf-8"; /* CSS Document */ p#vanlig{} p#indent{text-indent: 25px;} p#space{letter-spacing: 0.25em;} p#height{line-height: 150%;} p#transform{ text-transform: uppercase;}
p#third{ position: static; }
p{border: 1px solid #333333;} p#first{} p#second{} p#third{ position: relative; left: 20px; top: 30px; } p#fourth{}
} @charset "utf-8"; /* CSS Document */ p{ border: 1px solid #333333; p#first{} p#second{} p#third{ border: 1px solid #f00; position: absolute; left: 20px; top: 30px; color:red; } p#fourth{}
} @charset "utf-8"; /* CSS Document */ p{ border: 1px solid #333333; p#first{} p#second{} p#third{ border: 1px solid #f00; position: fixed; left: 20px; top: 30px; color:red; font-weight: bolder; } p#fourth{}
• •
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
•Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel …
@charset "utf-8"; /* CSS Document */ p{ } img{ margin: 10px; } p#first{} p#second{} p#third{} p#fourth{}
• • • @charset "utf-8"; • /* CSS Document */ • p{ • • } • img{ • } • p#first{} • p#second{} • p#third{} • p#fourth{} margin: 10px; float:left
@charset "utf-8"; /* CSS Document */ p{ float:right } img{ margin: 10px; float:right } p#first{} p#second{} p#third{} p#fourth{}
} } img{ display:block; margin: 10px;
Lorem ...
@charset "utf-8"; #content { background-image:url(book_600.jpg); margin:50px; width:500px; padding-top:0px; padding-left:95px; padding-below:25px;} { p font-family:Arial, Helvetica, sans-serif; margin:15px; } padding:30px; padding-top:10px; margin:20px; width:120px; { h1 font-family:Arial, Helvetica, sans-serif; margin:15px; padding:2px; padding-top:10px; padding-left:30px; } margin:20px; width:120px;
#content { background-image:url(book_600_1.jpg); background-repeat:repeat-y; margin:50px; width:500px; padding-top:0px; padding-left:95px; padding-below:25px;}
Lorem ipsum ...
@charset "utf-8"; h1#header { color:#036; font-size:120%; font-weight:normal; text-transform:uppercase; text-align:center; letter-spacing: .5em; padding: .4em 0; border-top: 1px solid #069; border-bottom:1px solid #069; background: url(bild.jpg) repeat-x; }L12
Första bilden
Andra bilden
Tredje bilden
Fjärdebilden
Femte bilden
width: 130px; float:left; margin: 0 10px 10px 0; background: url(Bild_bak.jpg) no repeat; }
Första bilden
Andra bilden
Tredje bilden
Fjärdebilden
Femte bilden
{width: 130px; float:left; margin: 0 10px 10px 0; background: url(Bild_bak.jpg) no-repeat;} div.thumbnail img {margin:10px 0 0 10px; border:1px solid #777;} { div.thumbnail p margin: 0; padding:0 20px 20px 10px; background: url(Bild_bak.jpg) no-repeat 0 100%; } { .clear
clear:left;}
div.thumbnail
{float:left;
width: 250px;
margin: 0 10px 10px 0;
padding-bottom:10px; border:1px solid #777;}
div.thumbnail img
{float: left;
border:1px solid #777;
margin:10px 10px 0 10px;}
{ div.thumbnail p margin: 0; padding:10px; }
Första bilden
Andra bilden
Tredje bilden
Fjärdebilden
Femte bilden
L13
Lorem ipsum ....
Julias Caesar