html work from web application
html work from web application
1 Introduction to HTML
HTML (HyperText Markup Language) is the standard language used to create web pages. It structures
the content on the web and defines elements such as headings, paragraphs, links, images, tables,
and more. HTML uses a system of tags to organize and display content in a web browser. Every
webpage is essentially a combination of HTML elements that tell the browser how to render text,
images, links, and other content.
HTML consists of various tags that provide structure to a webpage. Here are some of the basic and
essential tags in HTML:
• <html>: This is the root element of an HTML page, and everything else is nested inside it.
• <head>: Contains metadata about the page, such as the title and links to stylesheets or
scripts.
• <title>: Specifies the title of the page (what appears in the browser tab).
• <body>: Contains the content of the webpage that is displayed to the user.
• <h1>, <h2>, <h3>, ...: These are heading tags, with <h1> being the highest level and <h6>
being the lowest.
• <li>: Defines a list item, used inside both <ul> and <ol>.
• <div>: A container element that groups content together (commonly used for layout).
• <span>: A container for inline content, often used to style specific parts of text.
2.3 Images
To display images on a webpage, the <img> tag is used. The <img> tag is self-closing and requires a
src attribute that specifies the image source (file path or URL). Optionally, you can also add an alt
attribute that provides alternative text in case the image cannot be displayed.
html
Copy code
• src: Specifies the path to the image file (relative or absolute URL).
• alt: Provides alternative text for screen readers and when the image fails to load.
Copy code
2.4 Lists
HTML provides two main types of lists: unordered lists and ordered lists.
Unordered Lists
An unordered list uses the <ul> tag, and list items are defined using the <li> tag. The items are
displayed with bullets by default.
html
Copy code
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Ordered Lists
An ordered list uses the <ol> tag, and the items are automatically numbered.
html
Copy code
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Nested Lists
You can nest lists within one another to create more complex structures. For example:
html
Copy code
<ul>
<li>Item 1
<ul>
<li>Sub-item 1</li>
<li>Sub-item 2</li>
</ul>
</li>
<li>Item 2</li>
</ul>
These basic HTML tags and elements form the foundation for building structured web content.