Jul 12, 2024
<h1> ... <h6>
for titles<p>
for paragraphs<a>
for hyperlinkscode.visualstudio.com
index.html
as the home page<!DOCTYPE HTML>
<title>
)<h1>
, <h2>
, etc.<p>Some Text</p>
<br>
for line breaks<hr>
for horizontal lines<!-- Comment -->
to add noteslyrics.html
<a>
and href
attribute<a href="url">Click Me</a>
target="_blank"
to open in new tabtitle
to show tooltipsmailto:email@example.com
<img>
with src
attribute for sourcealt
attribute for alternative textheight
and width
for resizingimages
folder<img src="images/dog.png" alt="Dog" height="200">
<audio>
element to embed audio filessrc
for sourcecontrols
for play/pause controlsautoplay
and loop
for additional settings<video>
element to embed video filessrc
for sourcecontrols
for play/pause controlsautoplay
, muted
, and loop
for additional settings.ico
, .png
, .gif
, .jpg
, .svg
<link rel="icon" href="images/favicon.ico">
<b>
or <strong>
<i>
or <em>
<u>
<small>
, <mark>
, etc.<div style="background-color:cyan;">Content</div>
<span style="background-color:tomato;">Content</span>
<ul>
with <li>
items<ol>
with <li>
items<dl>
with <dt>
terms and <dd>
definitions<table>
, <tr>
(row), <th>
(header), <td>
(data)<table>
<tr><th>Day</th><th>Hours</th></tr>
<tr><td>Monday</td><td>9-5</td></tr>
</table>
border
, width
, height
, align
<button>
or <input type="button">
<button onclick="location.href='page2.html';">Click Me</button>
<form>
with action
and method
attributes<input>
, <textarea>
, <select>
, <option>
, <button>
<form action="submit.php" method="post">
Name: <input type="text"><br>
<input type="submit">
</form>
<header>
and <footer>
to organize content<header>Site Name</header>
<footer>Contact Info © 2023</footer>
<style>
body {background-color:black; color:white;}
</style>
body {color: tomato;}
.box {background-color: #333333;}
font-family: Arial, sans-serif;
font-size: 16px;
border-width
, border-style
, border-color
, border-radius
.box {border: 2px solid red;}
text-shadow: 2px 2px 5px #000;
box-shadow: 2px 2px 5px #000;
margin-top
, margin-right
, margin-bottom
, margin-left
margin: 10px;
.box {margin: 10px auto;}
.box {float: left;}
visible
, hidden
, scroll
, auto
.box {overflow: hidden;}
block
, inline
, inline-block
, none
.box {display: inline-block;}
visibility: hidden;
for hiding without removing from the layoutwidth
, height
, min-width
, min-height
, max-width
, max-height
px
, %
, em
.box {width: 50%; height: 100px;}
static
, relative
, absolute
, fixed
, sticky
.box {position: relative; top: 10px; left: 20px;}
background-image: url('image.jpg');
background-repeat
, background-position
, background-size
), Child (>
), Sibling (~
), Adjacent Sibling (+
)ul > li {color: red;}
:hover
, :active
, :focus
, :nth-child
(n), :not
(selector)a:hover {color: red;}
::before
, ::after
, ::first-letter
, ::first-line
, ::selection
p::first-letter {font-size: 200%; color: red;}
<div class="pagination">
<a href="#">«</a>
<a href="#" class="active">1</a>
<a href="#">2</a>
<a href="#">»</a>
</div>
<div class="drop-down">
<button>Menu</button>
<div class="content">...</div>
</div>
<nav class="navbar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<header>Site</header>
<nav>Menu</nav>
<main>Content</main>
<footer>Contact</footer>
<div class="gallery">
<img src="images/pic1.jpg" alt="Pic 1">
<div class="desc">Description</div>
</div>
<script src="https://kit.fontawesome.com/yourkitcode.js"></script>
<i class="fa fa-home"></i>
flex-direction
, justify-content
, align-items
.container { display: flex; }
.container .item { flex: 1; }
transform: rotate(45deg);
.box {transform: translate(50px, 100px);}
animation-name
, duration
, timing-function
@keyframes slide {
from {left: 0;}
to {left: 100px;}
}
.box { animation: slide 2s;}