Layout Basics
HTML (HyperText Markup Language) defines the structure and content of web pages, forming the skeleton of a webpage.
The layout refers to the arrangement
of a page's structure and information.
Review of Basic HTML Structure
An HTML document, which makes up a webpage, has the following basic structure:
Basic HTML Structure
<!DOCTYPE html> <html> <head> <!-- Basic information of the webpage --> <title>Page Title</title> </head> <body> <!-- The part visible to the user --> </body> </html>
The <head>
contains metadata and styles for the document, while the <body>
contains the content visible to the user.
Block Elements and Inline Elements
HTML elements are broadly divided into Block elements and Inline elements.
Block Elements
: Block elements occupy the full width of the page and each element starts on a new line. Elements such as<div>
,<h1>
, and<p>
are block elements.
HTML Block Elements
<div>div is a block element</div> <p>p is a block element</p>
Inline Elements
: Inline elements take up only the space necessary for their content and display continuously without line breaks. Elements such as<span>
,<a>
, and<img>
are inline elements.
HTML Inline Elements
<span>span is</span> <span>an inline element.</span>
Containers & Items
A container groups several elements into one unit. <div>
and <section>
are representative container elements.
div Container Element
<div> <p>Hello!</p> <p>Nice to meet you!</p> </div>
Mission
0 / 1
An inline element
occupies the full width of the screen.
True
False
Lecture
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help