0% found this document useful (0 votes)
4 views

html work from web application

nice

Uploaded by

ritanshugod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

html work from web application

nice

Uploaded by

ritanshugod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2.

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.

2.2 Basic Tags in HTML

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.

• <p>: Defines a paragraph of text.

• <a>: Creates a hyperlink to another webpage or resource.

• <ul>: Defines an unordered list.

• <ol>: Defines an ordered list.

• <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.

Example of embedding an image:

html

Copy code

<img src="image.jpg" alt="A description of the image">

• 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.

• width and height: Control the image size (in pixels).


html

Copy code

<img src="logo.png" alt="Company Logo" width="100" height="100">

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.

You might also like