Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 2.25 KB

html_basics.md

File metadata and controls

49 lines (40 loc) · 2.25 KB

HTML Basic Cheat Sheet

Essential HTML Elements

Concept Description
<!DOCTYPE html> Declaration to define document type
<html> Begins the HTML document
<title> Sets the title of the page (appears in the browser tab)
<head> Contains metadata about the document (like the title, links to stylesheets)
<body> Contains the main content of the page
<meta> Provides metadata, such as author and character encoding
<author> Specifies the author of the page

Tables

Element Description
<table> Starts the table
border= Specifies the table's border size
<tr> Defines a row in the table
<th> Defines the header cell (usually the first row)
<td> Defines a regular cell in the table
colspan= Merges cells horizontally (across columns)
rowspan= Merges cells vertically (across rows)

Forms

Element Description
<form action="mailto:[email protected]" method="get"> Defines a form and its submission method (via email in this case)
<input type="radio" name="name"> Radio button (select one option, e.g., Yes/No)
<label> Defines a label for form elements, placed inside text fields
<input type="text" name="name"> Defines a text input field
<input type="reset" name="Reset"> Reset button to clear form
<input type="submit" name="Submit"> Submit button for the form
<input type="checkbox" name="name"> Checkbox (select one or more options)
<select name="listName"> Drop-down list
<option value="0,1,2,..."> Options within a drop-down list
<textarea rows="number" cols="number"> Text area for multi-line input (e.g., comments)
<iframe src="file.html" width="100%" height="650px"> Embeds another HTML document or web page within the page

Text in HTML and Body Content

Concept Description
Text content Text inside the <body> tag represents the visible content of the web page
Body content Any content placed inside <body> is shown on the browser's screen