WT UNIT 1
WT UNIT 1
<!DOCTYPE html>: A declaration that tells the web browser this is an HTML5
document. It ensures the browser knows how to render the page using HTML5 rules.
<html>: The root element that wraps all content.
<head>: Contains meta-information (metadata) that is not displayed directly on the
web page but provides essential information like page title and links to CSS.
<meta charset="UTF-8">: Specifies the character set for the document, ensuring proper
display of special characters.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> : Ensures the
page is responsive by controlling the page's dimensions and scaling.
<title>: The title shown on the browser tab.
<body>: Contains all visible content, such as text, images, and elements.
Example:
<meta charset="UTF-8">
<h1>Welcome to My Website</h1>
Web page design involves structuring content and making it visually appealing using
CSS. The layout may include sections such as headers, navigation bars, content areas,
sidebars, and footers.
Example Layout Structure:
<body>
<header>
<h1>Site Title</h1>
</header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<main>
<article>
<h2>Article Title</h2>
</article>
<aside>
<h3>Sidebar</h3>
</aside>
</main>
<footer>
</footer></body>
o href: Specifies the URL of the page the link points to.
o target: Specifies where to open the linked document (e.g., _blank for a new
tab).
Example:
Example:
Example:
5. Formatting Text
Bold: Use <b> for stylistic bold and <strong> for importance.
Italics: Use <i> for stylistic italics and <em> for emphasis.
Underline: <u> is less commonly used, as CSS is preferred.
Superscript: <sup> displays text as superscript (e.g., exponents).
Subscript: <sub> displays text as subscript (e.g., chemical formulas).
Example:
Title: Defined in the <head> section and appears on the browser tab.
Headings: Ranges from <h1> (largest) to <h6> (smallest), providing hierarchy.
CSS Styling for Colors and Fonts:
Color options:
Can be defined using names (red), HEX (#FF0000), RGB (rgb(255, 0, 0)), or HSL
(hsl(0, 100%, 50%)).
Example:
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
</tr></table>
Example:
Example:
Frames (Deprecated): <frame> and <frameset> were used to split a page into separate
sections, but are now replaced by iframe or CSS-based layouts.
Positions elements to the left or right, allowing other elements to wrap around them.
Example: