What is HTML..?
HTML (HyperText Markup Language) provides the fundamental structure of web pages. It defines the content and organization of information on the web. While HTML focuses on meaning and structure, other technologies like CSS (Cascading Style Sheets) and JavaScript enable web pages to have visual styling and interactive functionality.
An Basic HTML document is structured with these core elements:
- The <!DOCTYPE html> declaration is the first line of an HTML document that informs the browser this page uses HTML5, the most current HTML version.
- The <html> element, as the root element of an HTML document, encompasses all other elements within the document.
- The <head> element contains metadata about the document, including the title, links to stylesheets, and scripts.
- The <title> element specifies the title for a document, which is displayed in a browser's title bar or tab for that page.
- The <body> element in HTML contains all the main content of the web page, including text, images, links, and other elements that make up the visible structure and information.
- Elements and Tags: HTML documents are made up of elements, which are enclosed in tags. tags are define the structure and appearance of content within an HTML document. For example, the <p> tag is used to define a paragraph, and the <img> tag is used to insert an image..
- Attributes: Tags can have attributes that provide additional information about the element. Attributes are placed inside the opening tag and are written as name-value pairs. For example, the <img> tag has attributes like src (source) and alt (alternative text).
Here's a basic example of an HTML document:
- <!DOCTYPE html>
- <html>
- <head>
- <title>My First Web Page</title>
- </head>
- <body>
- <h1>Hello, World!</h1>
- <p>This is a paragraph of text.</p>
- <img src="image.jpg" alt="An image">
- </body>
- </html>
In this example, the <h1>
tag defines a heading, the <p>
tag defines a paragraph, and the <img>
tag inserts an image. The src
attribute in the <img>
tag specifies the source of the image file, and the alt
attribute provides alternative text for the image. To learn and practice HTML code start using an online compiler for HTML.
Thanks for Reading!! Keep Follow and Support us.
0 Comments