anatomy CSS
selector {property: value;} contoh : h1 {color:blue;}
selector :
- digunakan untuk memilih dan memanipulasi elemen spesifik pada HTML
- elemen HTML dipilih berdasarkan tag, id, class bahkan pola/pattern.
- semakin kompleks struktur HTML, selector juga bisa semakin kompleks/spesifik
arti : h1 {color:blue;}
CSS, pilih seluruh elemen h1, lalu ubah teks didalamnya menjadi berwarna biru
http://css-tricks.com/almanac
MENEMPATKAN CSS
-embed
<style></style>
-inline
<p style="color: lightblue;"> ...</p>
-external
<link rel="stylesheet" href="style.css">
contoh :
embed
<html>
<head>
<title>contoh CSS menggunakan EMBED</title>
<style>
h1 {
color: lightblue;
font-family: arial;
}
</style>
</head>
<body>
<h1>hello world</h1>
<p> And the web just isn't the same without you. Let's get you back online!
Checking your network cables, modem, and routers Reconnecting to your wireless
network Running Windows Network Diagnostics
</p>
</body>
</html>
contoh inline :
<html>
<head>
<title>contoh CSS menggunakan INLINE</title>
</head>
<body>
<h1 style="color: lightblue; font-familiy: arial;">hello world</h1>
<p> And the web just isn't the same without you. Let's get you back online!
Checking your network cables, modem, and routers Reconnecting to your wireless
network Running Windows Network Diagnostics
</p>
</body>
</html>
contoh external :
<html>
<head>
<title>contoh CSS menggunakan EKSTERNAL</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>hello world</h1>
<p> And the web just isn't the same without you. Let's get you back online!
Checking your network cables, modem, and routers Reconnecting to your wireless
network Running Windows Network Diagnostics
</p>
</body>
</html>