Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write the adaptive code for the middle and bottom layout of a web page, that is, fixing it up and down.

Shulou Source: shulou.com Published: 2022-06-03 08:06:44 09月30日 Update

This article mainly introduces "how to write the middle and bottom three-part layout of a web page, that is, the middle adaptive code that is fixed up and down." in the daily operation, I believe that many people have doubts about how to write the middle and bottom three-part layout of the web page, that is, the middle adaptive code. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful for you to answer the question of "how to write the middle and bottom three-part layout of the web page, that is, the self-adaptive code that is fixed up and down". Next, please follow the editor to study!

The code is as follows:

* {

Margin:0

Padding:0

}

Html

Body

# box {

Height:100%

Font:small/1.5 "Song style", serif

}

Body {

Text-align:center

}

# box {

Text-align:left

Background:#666

Display:table

Width:80%

Margin:0 auto

Position:relative

}

# box > div {

Display:table-row

}

# header

# footer {

Background:#fcc

Height:50px

Vertical-align:bottom

}

# main {

Background:#ccf

}

# main # wrap {

Display:table-cell

Background:#ffc

Vertical-align:middle

}

# text {

Text-align:center

}

Header

Test text

Footer

At this point, the study on "how to write the middle and bottom three-part layout of the web page, that is, the middle adaptive code fixed up and down," is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Code up and down layout web page learning more help practical next Song style text article method theory knowledge article website material follow question Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia Shulou Tech Info Shulou Information Xiaomi