Hyper Text Markup Language
Sederhananya, cuma simpel teks file yang berekstensi `.html`
Buat teks dan simpan dengan nama halo.html
Ini adalah html web page<!-- tidak di tampilkan oleh browser -->
<!-- berguna untuk memberi komentar /dokumentasi saat development --><!DOCTYPE html>
<html>
<body>
ini adalah html web page
</body>
</html>Perbarui file sebelumnya
<!DOCTYPE html>Hanya menginformasikan ke browser bahwa kita menggunakan HTML5
<html><body></html></body><tag attribute="value"></tag><div id="container" class="initial"></div>
Opening Tag
Closing Tag
Attributes
HTML
<title>Ini disebut element title</title>Apa yang ingin kita lihat di web browser itu disebut element
<head>
<title>My web page</title>
</head><!DOCTYPE html>
<html>
<head>
<title>My web page</title>
</head>
<body>
ini adalah html web page
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>My web page</title>
</head>
<body>
<p>ini adalah html web page</p>
</body>
</html>H1 is primary
H1 should only once in page
H2-H6 is a secondary element
<p>Ini paragraph teks</p><!DOCTYPE html>
<html>
<head>
<title>My web page</title>
</head>
<body>
<h1>My first web page</h1>
<h2>What this is</h2>
<p>A simple page put together using HTML</p>
<h2>Why this is</h2>
<p>To learn HTML</p>
<p>ini adalah html web page</p>
</body>
</html><div>
ini element block
<p>
ini paragraf
<span>ini inline span didalam pargraf</span>
</p>
</div><strong>Ini bold teks</strong><br>
<p>Ini adalah html web page</p><p>Ini bold teks</p>
<hr>
<p>Ini adalah html web page</p><!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
</head>
<body>
<h1>My first web page</h1>
<h2>What this is</h2>
<p>A simple page put together using HTML</p>
<h2>Why this is</h2>
<ul>
<li>To learn HTML</li>
<li>To show off</li>
<li>Because I've fallen in love with my computer and
want to give her some HTML loving.</li>
</ul>
</body>
</html><!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
</head>
<body>
<h1>My first web page</h1>
<h2>What this is</h2>
<p>A simple page put together using HTML</p>
<h2>Why this is</h2>
<ul>
<li>To learn HTML</li>
<li>
To show off
<ol>
<li>To my boss</li>
<li>To my friends</li>
<li>To my cat</li>
<li>To the little talking duck in my brain</li>
</ol>
</li>
<li>Because I've fallen in love with my computer and
want to give her some HTML loving.</li>
</ul>
</body>
</html>
<
>
©
—
Types of meaning element and used the same as block element div:
header element
section element
article element
footer element
hgroup element
nav element
figure element
address element
<img src="https://www.xcidic.com/static/xcidic-logo.svg" width="120" height="90" alt="Xcidic.com">
html
head
body
title
style
script
meta
link
h1
div
img
footer
ul
text
span
a
p
text
li
li
script
Element <em>
Element <strong>
Element <i>
Element <b>
Element <q>
Element <blockquote>
Element <cite>
Element <abbr>
Element <sub>
Element <sup>
<strong>Ini bold teks</strong><em>Ini italic teks</em>The “H” and “T” in “HTML” stand for “hypertext”, which basically means a system of linked text.
<a href="https://www.google.com">Google</a>table
<table>
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
<td>Row 1, cell 3</td>
</tr>
<tr>
<td>Row 2, cell 1</td>
<td>Row 2, cell 2</td>
<td>Row 2, cell 3</td>
</tr>
<tr>
<td>Row 3, cell 1</td>
<td>Row 3, cell 2</td>
<td>Row 3, cell 3</td>
</tr>
<tr>
<td>Row 4, cell 1</td>
<td>Row 4, cell 2</td>
<td>Row 4, cell 3</td>
</tr>
</table><table>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>form
<form action="contactus.php" method="post">
<p>Name:</p>
<p><input type="text" name="name" value="Your name"></p>
<p>Species:</p>
<p><input name="species"></p>
<!-- remember: 'type="text"' isn't actually necessary -->
<p>Comments: </p>
<p><textarea name="comments" rows="5" cols="20">Your comments</textarea></p>
<p>Are you:</p>
<p><input type="radio" name="areyou" value="male"> Male</p>
<p><input type="radio" name="areyou" value="female"> Female</p>
<p><input type="submit"></p>
</form>Cascading Style Sheets
<p style="color: red">text</p>
<!DOCTYPE html> <html> <head> <title>CSS Example</title> <style> p { color: red; } a { color: blue; } </style>
p {
color: red;
}
a {
color: blue;
}<!DOCTYPE html>
<html>
<head>
<title>CSS Example</title>
<link rel="stylesheet" href="style.css">body { font-size: 14px; color: navy; }
Selector
property
value
opening declaration
ingat semicolon
closing declaration