Design Layout - Website layout in CSS
Layout design or layout design is the first and very important step in the process of designing a website. There are a number of ways to design websites with CSS, but the technique is being used in a popular and highly effective way now is to combine HTML Div with CSS. Using this way, your website will run smoothly, meeting certain user requirements. So let TipsMake.com learn more about this method through the following article.
Layout - Website layout
Layout can understand how we layout the main components on a web page.
In the Layout design, tags
A website is usually divided into sections including header, menu bar, content and footer.
There are many types of website styles, TipsMake.com will introduce more in the following sections. However, basically the structure above is most used. The article will analyze website design with the above layout.
Header
Headers are usually located at the top of the site (or just below the top navigation menu). This section usually contains a logo or website name or some website slogans.
.header {
background-color: #e9d8f4;
color: #58257b;
text-align: center;
padding: 20px;
}
Full code:
Thiết kế Layout - Bố cục website trong CSS
Website TipsMake.com
Navigation bar
Navigation Bar - Navigation Bar , also known as menu bar, is used to navigate main items on the website.
/* class thanh điều hướng */
.topnav {
overflow: hidden;
background-color: #333;
}
/* link điều hướng */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Thay đổi màu liên kết khi di chuột qua */
.topnav a:hover {
background-color: #ddd;
color: black;
}
Full code:
Thiết kế Layout - Bố cục website trong CSS
Website TipsMake.com
Làng Công nghệ
Công nghệ
Khoa học
content
The layout in this section usually depends on the user object. The common layout is one or a combination of the following:
- 1 column: usually used for mobile browsers.
- 2 columns: often used for laptops and tablets.
- 3 columns: often used for desktop browsers.
You can create a 3-column layout and change it to a 1-column layout on a smaller screen like this:
/* Tạo ba cột bằng nhau, float cạnh nhau */
.column {
float: left;
width: 33.33%;
}
/* Clear float khác sau các cột */
.row:after {
content: "";
display: table;
clear: both;
}
/* Bố cục linh hoạt: ba cột xếp chồng lên nhau thay vì cạnh nhau khi màn hình
có chiều rộng dưới 600px */
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
Full code:
Thiết kế Layout - Bố cục website trong CSS
Website TipsMake.com
Làng Công nghệ
Công nghệ
Cuộc sống
Technology Village
Stay up to date with the latest trends, discoveries, and research on science
technology.
Technology
including tips, instructions for using software, hardware, fixing errors
network, fix computer errors on many operating systems such as Windows, macOS, Linux,
Android, iOS .
Life
Life skills, job skills, leadership skills, life tips,
things you may not know, good sayings about life, sayings
famous of Jack Ma, Bill Gate, Steve Jobs .
Try changing the browser size, when the screen is less than 600px wide, the columns will overlap instead of lying side by side:
Tip: If you want to create a web layout with only 2 columns, set the width attribute to 50%, similar to 4 columns, then 25% .
Create unequal columns
Content is the largest and most important part of your website.
Most of a website, the layout of columns will not be equally divided, the content is the largest and most important part of the site, so it will occupy the most space. Secondary content (if any) is often used to switch to another link or specify information related to the main content.
By using CSS, you can change the column width as you like. Note that the sum of columns should be 100% valid.
.column {
float: left;
}
/* Cột bên trái và phải */
.column.side {
width: 25%;
}
/* Cột chính giữa */
.column.middle {
width: 50%;
}
/* Bố cục linh hoạt: ba cột xếp chồng lên nhau thay vì cạnh nhau khi màn hình
có chiều rộng dưới 600px */
@media screen and (max-width: 600px) {
.column.side, .column.middle {
width: 100%;
}
}
Full code:
Thiết kế Layout - Bố cục website trong CSS
Website TipsMake.com
Làng Công nghệ
Công nghệ
Cuộc sống
Guide
You can share your article on the page if you have an account, you
You can view posted articles, view other members' posts and find
Find the article you care about on the page.
Introduce
TipsMake.com is a social network about science and technology, expanding content
to meet the needs of members in more technology areas such as
phone, smart device, electronics, computer security .
You can become a part of TipsMake.com by posting
write, experience your technology for the content management team of
Social network via email info@meta.vn
Contact
Address: 56 Duy Tan, Dich Vong Hau, Cau Giay, Hanoi.
Phone: 024 2242 6188.
Email: info@meta.vn.
Try changing the browser size, when the screen is less than 600px wide, the columns will overlap instead of lying side by side:
Footer
Footer is located at the bottom of the page, usually contains information such as copyright, contact information .
.footer {
background-color: #e9d8f4;
color: #58257b;
padding: 5px;
text-align: center;
}
Full code:
Thiết kế Layout - Bố cục website trong CSS
Website TipsMake.com
Làng Công nghệ
Công nghệ
Cuộc sống
Guide
You can share your posts on the page if you have an account.
Introduce
TipsMake.com is a social network about science and technology, expanding content
to meet the needs of members in more technology areas such as
phone, smart device, electronics, computer security .
Contact
Phone: 024 2242 6188.
Email: info@meta.vn.
License No. 362 / GP-BTTTT. Ministry of Information and Communications issued on June 30, 2016.
Sample layout
Website TipsMake.com
Knowledge - Experience - FAQ
Làng Công nghệ
Công nghệ
Cuộc sống
Đăng ký
Form - Form in CSS
Quách Tỉnh, February 14, 2019
Forms are an integral part of any kind of website.
In this article, TipsMake.com will show you how to build the section
display interface of a basic form. This interface can be done
Pretty nice with CSS
Attribute Selector in CSS
Quách Tỉnh, 12/02/2019
Attribute selector is the way to select the elements you want to type in
HTML documents are based on the attributes of one or more HTML tags.
Attribute selector can select objects without having to
declare adding Classes or IDs into HTML tags and still be able to navigate
get to those components, make the code more neat and coherent.
Introduce
TipsMake.com is a social network about science and technology.
Highlights
Image
Image
Image
Follow Me
YouTube
License No. 362 / GP-BTTTT. Ministry of Information and Communications issued on June 30, 2016.
Previous post: Counter - CSS counter
Next lesson: Unit - Unit of measurement in CSS
You should read it
- Layout in HTML
- How to use Windows 11's Snap Layout on Windows 10
- Tips to help you create responsive layouts easily
- How to turn off Snap Layout in Windows 11
- How to create a custom keyboard layout for Windows 10
- How to change the keyboard layout in Linux
- 5 types of simple job CV layout - beautiful is worth learning
- Improved photo, video layout without cropping on iPhone 11, iPhone 11 Pro
May be interested
- How to design a website in Photoshop (Part 2): Create a Landing page for travel websitesin this tutorial, we will use photoshop cs6 to design a simple, clean landing page for a travel website. in this process, you will be taught how to create custom grids with links, create fonts, use a lot of white space and compose web content in a professional way.
- 10 tips to complement website designcurrently, website design is becoming easier and more convenient. the following article will introduce you to read 10 small advantages in website design to increase the usefulness of websites
- How to design profile photos on Profile Pic Maker for freewebsite profile pic maker will design profiles for the website, create online logos for social networks, help you get more choice of website logos, profile photos more personal.
- Design website with Adobe Dreamweaver CS5 software - Part 3part 3 will show you how to create a template, which is an indispensable page for website design with dreaweaver, because it helps create a consistent structure for both the website system and change this structure easily. easy, faster ...
- Structure of a standard SEO Google websiteseo standard website design is one of the important things that contribute significantly to the ranking of the website in the process of making seo. a website that is considered an seo standard must ensure the following factors
- Instructions for creating a website using Dreamweaver CC - Part 8: Publishing a websitein the eighth and final part of this series, we will learn how to set up a remote site to publish web pages.
- Layout in HTMLwebsites often display content in the form of columns (like in newspapers or magazines).
- How to use Windows 11's Snap Layout on Windows 10snap layout is one of the standout features of windows 11. when you have a bunch of windows open across different apps, windows 11 lets you arrange them all on the screen based on different layouts, then that are saved in a particular arrangement.
- How to convert any website into a Figma designfigma is a great tool that is quickly becoming a favorite of web and ux/ui designers. you can create responsive web designs quickly and easily using this free browser-based tool.
- Design website running on multiple devices (responsive web design) in HTMLresponsive web design just uses html and css to automatically resize, hide, minimize, enlarge a website.