Aug 24, 2024
index.html
file.<!DOCTYPE html>
<html>
(opening and closing)<head>
(information about the web page)<body>
(content displayed to users)<title>
tags.<h1>
, <h2>
, etc.) for titles.<p>
tags for paragraphs.<br>
tags.<hr>
for horizontal rules to divide sections.<title>My First Website</title>
is an element made up of tags.<!-- comment here -->
.<a>
tags.
href
attribute for URLs.target
attribute to open links in new tabs (e.g., target="_blank"
).<a href="http://www.google.com" target="_blank">Go to Google</a>
<img>
tags for images.
src
attribute to the image file.alt
for alternative text.title
for a tooltip on hover.<audio>
element with controls
attribute for playback.
<audio controls src="audiofile.mp3"></audio>
<video>
element, similar to audio.
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<b>
<i>
<sub>
<sup>
<ins>
<del>
<mark>
<ul>
and <li>
tags.<ol>
and <li>
tags.<dl>
, <dt>
, and <dd>
tags.<table>
for tables, <tr>
for rows, <th>
for headers, and <td>
for data cells.<table>
<tr>
<th>Day</th>
<th>Hours</th>
</tr>
<tr>
<td>Monday</td>
<td>9am - 5pm</td>
</tr>
</table>
style
attribute.
style="background-color: black; color: white;"
<head>
section.<meta name="description" content="...">
<meta name="keywords" content="...">
<meta name="author" content="...">
<iframe>
tags.<iframe src="https://www.bing.com" width="750" height="250"></iframe>
<button>
tags for buttons.<button>Click Me</button>
<form>
tags to create forms.
<input>
for user input, specify type
and other attributes.<form>
<label for="fname">First Name:</label>
<input type="text" id="fname" name="fname" placeholder="Enter your first name">
</form>
get
and post
.required
attribute for mandatory fields.