8 Dasar - Css
8 Dasar - Css
<p style="color: green"> <style type="text/css"> h1 {color: blue} </style> <link rel="stylesheet" type="text/css" href="http://webku.com/cool.css"> <style type="text/css"> @import url(http://webku.com/cool.css); </style>
<html> <head> <style type="text/css"> body {color: navy} h1 {font-family: Arial} b {text-decoration: underline} </style> </head> <body> <h1>Ini <b>Homepage</b> Saya</h1> Ini adalah homepage yang menggunakan CSS. </body> </html>
h1 {color: green} i {font-style: normal}
.mhs {border: black solid 1; color: gray} .nama {font: bold 20 Arial}
li ul li ul ol li li.mhs ul ol li.mhs #mhs01 {...} {...} {...} {...} {...} {...} /* /* /* /* /* /* a=0 a=0 a=0 a=0 a=0 a=1 b=0 b=0 b=0 b=1 b=1 b=0 c=1 c=2 c=3 c=1 c=3 c=0 -> -> -> -> -> -> specificity specificity specificity specificity specificity specificity = 1 = 2 = 3 = 11 = 13 = 100 */ */ */ */ */ */
:first-letter :first-line
p:first-letter { font-size: 200%; float: left} p:first-line { color: green } h1.mhs:first-letter { font-size: 20pt }
<html> <head> <title>Drop cap initial letter</title> <style type="text/css"> p:first-letter { font-size: 200%; font-weight: bold; float: left } span { text-transform: uppercase } </style> </head> <body> <p><span>The first</span> few words of an article in The Economist.</p> </body> </html>
white black red
#ff0000
rgb(255,255,0)
rgb(80%,80%,100%)
<fontname>
p {font-family: Arial, Verdana, "Times New Roman"} p {font-style: italic}
p {font-variant: small-caps}
<length> <percentage>
p p p p {font-size: {font-size: {font-size: {font-size: large} smaller} 200px} 150%}
p p p p p
p p p p p
<color>
{color: {color: {color: {color: {color: red} #448F2C} rgb(255,0,0)} rgb(100%,50%,25%)} #f25}
<color>
body {background-color: transparent}
<url>
body {background-image: none} body {background-image: url(http://www.site.com/logo.gif)} body {background-repeat: no-repeat}
<percentage> <length>
{background-position: {background-position: {background-position: {background-position: 50%} 200px 50%} center} right bottom}
<color>
<image>
<repeat>
<attachment>
<position>
<length> <percentage>
p {text-indent: 5em}
p {text-align: justify}
<color>
h1 {text-transform: capitalize}
<length>
p {letter-spacing: 3px} p {letter-spacing: -1px}
<length>
p {word-spacing: 2em}
p {white-space: pre}
ul {list-style-type: circle}
<url>
ul {list-style-image: url(smiley.gif)}
ul {list-style-position: inside}
outside
inside
<style>
<position>
<image>
div div div div {margin-top: 10px} {margin-right: 20%} {margin-bottom: -5px} {margin-left: 20pt}
<length> <percentage>
<length> <percentage>
{margin: {margin: {margin: {margin: 3em} 1em 2em} 5em 2em 3em} 8em 4em 15em 10em}
div div div div {padding-top: 10px} {padding-right: 20%} {padding-bottom: -5px} {padding-left: 20pt}
<length> <percentage>
div div div div
<length> <percentage>
div {padding: 8em 4em 15em 10em}
<length>
{border-top-width: thin} {border-right-width: 6px} {border-bottom-width: 2em} {border-left-width: 10}
<width>
div {border-width: thin medium 10 20}
<color>
div {border-top-color: green} #ff66cc} div {border-bottom-color: rgb(0,128,0)} div {border-right-color: div {border-left-color: #ee3}
<color>
div {border-color: green #ff66cc rgb(128,128,128) #ee3}
div div div div
<style>
div {border-style: solid dashed solid dotted}
<width>
<style>
<color>
{border-top: solid red} {border-right: thick double} {border-bottom: red dashed blue} {border-left: outset 10}
<width>
<style>
<color>
<length> <percentage>
img {width: 40%}
<length> <percentage>
img {height: 100px}
p {display: block} b {display: inline} li {display: list-item} img {display: none}
<url>
p {cursor : crosshair} p {cursor : url("mything.cur"), url("second.csr"), text}
<style type="text/css"> @font-face { font-family: "Robson Celtic"; src: url("http://site/fonts/rob-celt") } H1 { font-family: "Robson Celtic", serif } </style>
<style type='text/css'> @media print { body {font-size: 10pt; background-color: white} .iklan .menu {display: none} } @media screen { body {font-size: 12pt; background-color: yellow} } @media screen, print { body {line-height: 1.2} } </style>
<shape>
div {clip: rect(5px, 10px, 10px, 5px)}
overflow: auto
visibility: hidden
div {position: absolute}
static
relative
absolute
fixed