Article Part
Some Detailed Text
While designing a web page, we must arrange the web page elements in an elegant way. They should be easy to navigate for the user and simple. It provides a way to arrange these elements in a well-structured manner. HTML layout gives a very good look to the web page and provides an easy way to design. It is a simple way by which we can design web elements using simple standard HTML tags. HTML offers various layout elements by using which we can design various parts of the web page.
In this article, we will see different layout elements and their examples. Using these elements, we will design a simple structure similar to the newspaper.
This element is used to define the header of the web page. It contains the title of the page or some logo or maybe introductory content.
Code:
<title> EduCba </title> <header style="height: 100px; width: 100%; background-color: #607D8B;"> <h1 id="Header-Section"> Header Section</h1> </header>
Output:
This element will contain links to the menu list. This element is like a container for different navigation links. The links will be on a different page or the same page.
Code:
Let us add a navigation element below our last example’s header. Add
<style> li{ display: inline-flex; padding: 25px } ul{ text-align: center; } </style> <nav style="background-color: #607d8b70;"> <ul> <li> <a href="#"> Navigation Link1 </a> </li> <li> <a href="#"> Navigation Link2 </a> </li> <li> <a href="#"> Navigation Link3 </a> </li> </ul> </nav>
Output:
This element is like the main section of the web page. It can contain any kind of information. It can contain text, images, etc.
As the name suggests, this element will contain content like a paragraph, any detailed description of something, or any kind of information. Generally, this will be the main part containing information on a web page.
This element will define the content at the side of the main content, like a section or article. This information element is optional and generally contains additional information or advertisement content.
Code:
Let’s add all these three elements together below the navigation bar.
<style> li { display: inline-flex; padding: 25px } section{ background-color: #607D8B; width: 79%; position: absolute; height: 150px; } article{ width: 79%; background-color: #607d8b70; position: absolute; top: 368px; height: 150px; } aside{ background-color: #607d8b99; width: 20%; position: absolute; left: 80%; height: 300px; } h2 , p { text-align: center; color: #9c27b0; } ul{ text-align: center; } </style> <div class="main"> <section> <h2 id="Section-Part"> Section Part </h2> <p> Some Text </p> </section> <article> <h2 id="Article-Part"> Article Part </h2> <p> Some Detailed Text </p> </article> <aside> <h2 id="Sidebar-Part"> Sidebar Part </h2> <p> This will contain static part or anything like advertisement etc. </p> </aside> </div>
Output:
This element displays extra details about the web page to the user. This may contain additional information which is optional for the user. This element, by default, provides a feature to show or hide details upon clicking.
This element is used along with the
Code:
Let us add details elements along with the summary element in our existing example. Add the code below after our aside section and article element parts in the
tag.<details> <summary> Summary: click here to show details</summary> <p> Details: Upon clicking summary element, details will be shown to the user </p> </details> <style> details { margin-top: 330px; width: 100%; padding-top: 10px; padding-bottom: 50px; padding-left: 15px; background-color: #607d8bdb; } details p { font-size: 18px; } summary { color: white; font-size: 22px; } </style>
Output 1: Without clicking on the details element.
Output 2: After clicking on the details element.
There will be one section at the bottom of every web page, known as a footer. This
Code:
Let us add-footer on our web page at the bottom part.
<footer style=" height: 100px; background-color:#607D8B; width: 100%; text-align: center;"> <h3 id="Footer-Section">Footer Section</h3> <p> © Copyright ( Year ) </p> </footer>
Output:
So our final code and its output will look like this,
Code:
EduCba Header Section
Section Part
Some Text
Article Part
Some Detailed Text
<footer style=" height: 100px; background-color:#607D8B; width: 100%; text-align: center;"> <h3 id="Footer-Section">Footer Section</h3> <p> © Copyright ( Year ) </p> </footer>Summary: click here to show details
Details: Upon clicking summary element, details will be shown to the user
Output:
So HTML layout elements are very much useful while designing a web page. They help developers to design well-structured web pages. Using these layout elements properly improves the reading experience of web pages. We have seen most of the main HTML layout elements in detail.
The above is the detailed content of HTML Layout. For more information, please follow other related articles on the PHP Chinese website!
The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159
The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.
The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.
Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.
The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.
The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for
The article explains the HTML 'class' attribute's role in grouping elements for styling and JavaScript manipulation, contrasting it with the unique 'id' attribute.
Article discusses HTML list types: ordered (<ol>), unordered (<ul>), and description (<dl>). Focuses on creating and styling lists to enhance website design.
AI-powered app for creating realistic nude photos
Online AI tool for removing clothes from photos.
Undress images for free
AI clothes remover
Swap faces in any video effortlessly with our completely free AI face swap tool!
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
Small size, syntax highlighting, does not support code prompt function
Chinese version, very easy to use
Powerful PHP integrated development environment
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.