📜  html doc - Html (1)

📅  最后修改于: 2023-12-03 15:15:33.534000             🧑  作者: Mango

HTML Doc

HTML (Hypertext Markup Language) is the standard markup language used to create web pages. It defines the structure and content of a web page through a series of tags and attributes.

Document Structure

The basic structure of an HTML document consists of a document type declaration, an HTML tag, and a head and body section.

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <h1>This is a Heading</h1>
    <p>This is a paragraph.</p>
  </body>
</html>
  • The <!DOCTYPE html> declaration defines the document type and version of HTML being used.
  • The <html> tag encloses the entire document.
  • The <head> section contains information about the document, such as the title and links to external stylesheets and scripts.
  • The <body> section contains the visible content of the web page.
Elements

HTML is largely based around the use of elements, which are defined by tags and attributes.

Tags

Tags are used to define the start and end of an element, and can be nested within each other to create more complex structures.

<p>This is a paragraph with <em>italicized</em> text.</p>
  • The <p> tag defines a paragraph element.
  • The <em> tag defines an element for text that should be emphasized or italicized.
Attributes

Attributes provide additional information about an element, and are defined within the opening tag using name/value pairs.

<img src="image.jpg" alt="Description of image">
  • The src attribute specifies the source URL of the image.
  • The alt attribute provides a description of the image for accessibility purposes.
Conclusion

HTML provides the core structure and content of a web page. By using tags and attributes, developers can create complex and visually appealing layouts with ease.