Web page
A web page is a digital document accessible through a web browser , typically written in HTML and often enhanced with CSS and JavaScript to provide structure , style , and interactivity.
Web pages are the building blocks of the World Wide Web, allowing users to access and interact with information online.
Key Components of a Web Page
HTML Structure
HTML (HyperText Markup Language) provides the basic structure of a web page using tags.
1. Head Section
The head section contains metadata and resources that are not displayed directly on the page but are essential for its functionality.
Example- Title Tag: Sets the title of the web page displayed in the browser tab.
- Meta Tags: Provide information about the page, such as the character set, author, and description.
- Link Tags: Connect external resources like CSS files.
- Script Tags: Include or reference JavaScript files.
2. Body Section
The body section contains the visible content of the web page.
Example- Headings: Defined by <h1> to <h6> tags, they structure the content hierarchically.
- Paragraphs: Defined by <p> tags, they organize text into readable blocks.
- Images: Embedded using the <img> tag.
- Links: Created with the <a> tag to navigate to other pages or resources.
- Lists: Ordered (<ol>) and unordered (<ul>) lists organize items.
3. Cascading Style Sheets (CSS)
CSS is used to style and layout web pages.
Example- Inline Styles: Applied directly to HTML elements using the style attribute.
- Internal Styles: Defined within a <style> tag in the head section.
- External Styles: Linked through a separate CSS file.
4. JavaScript
JavaScript adds interactivity and dynamic behavior to web pages.
Example- Inline Scripts: Written directly within HTML tags using the onclick attribute.
- Internal Scripts: Placed within <script> tags in the HTML file.
- External Scripts: Linked through a separate JavaScript file.
5. Meta Tags
Meta tags provide metadata about the web page, which is used by browsers and search engines.
Example- Charset: Specifies the character encoding.
- Description: Summarizes the content for search engines.
- Viewport: Controls the page's dimensions and scaling on mobile devices.
6. Links
Links connect web pages and resources.