Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of html Elastic width layout

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today Xiaobian to share with you html elastic width layout method related knowledge points, detailed content, clear logic, I believe most people still know too much about this knowledge, so share this article for everyone to refer to, I hope you read this article after some gains, let's learn about it together.

HTML structural web page template, width in em unit elastic width mechanism centered html web page template frame resources.

Organize centered width in em units Elastic Web Template

It seems that we configure the width as the value of em unit, the theory em is absolute unit, if the reader default font is different then em conversion value will be different, artificial will cause the web page to be elastic width. Note that when setting the font size of the body device, it must be configured to 100%, which reader will arbitrarily give the font size according to the platform default. If you set a static font size such as 12px, then the mechanism out of em width structure will be passive static, layout width is not elastic width.

Template code (can be copied directly):

Flexible Width and Center Layout html template online presentation CSS5body {font: 100% Song, New Song;background: #66666;margin: 0;padding: 0;text-align: center;color: #00000;}#container {width: 46em;bac kg round: #FFFFFF;margin: 0 auto;border: 1px solid #00000;text-align: left;}#mainContent {padding: 0 20px;}

Template Introduction

Here, the absolute width of the box configured for the structure layout is set to 46em, which is also equal to the width of the reader to the font size. For example, the default font size of the reader is 16px, so the width is 16px *46= 736px. If the default font size of the other reader is 22px, then the width will be twisted to complete the construction of the web page width flexibility, and fixed.

Romance of the Three Kingdoms

In April of the second year of Jianning, the emperor went to Wende Hall. When he ascended his seat, a storm rose from the corner of the temple. A large green snake flew down from the beam and coiled around the chair. The emperor was shocked and fell, and he was rescued into the palace. All officials fled to avoid him. In the blink of an eye, the snake disappeared. Suddenly there was heavy thunder and heavy rain, plus hail, falling until the third drum, but there were several damaged houses. In the middle spring of the fourth year of Jianning, Luoyang earthquake; salt water overflowed, and the inhabitants of the hinterland were all swept into the sea by big waves. In the first year of Guanghe, the hen turned male. On the first day of the sixth month, black gas flew into Wende Hall for more than ten feet. Autumn July, there is a rainbow in the jade hall; Wuyuan mountain shore, all cracked. All kinds of good luck, not only one end. The emperor issued an edict to ask the ministers about the cause of the disaster, and Cai Yong, a counselor, wrote a letter saying that the fall of chickens was caused by the interference of women's temples in government affairs. His words were quite straightforward. The emperor read the memorial and moaned, so he got up and changed clothes. Cao Jie secretly watched from behind and revealed all the things under his control. Therefore, he was convicted of other things and released to the field. Later, Zhang Rang, Zhao Zhong, Feng Wei, Duan Gui, Cao Jie, Hou Lan, Jian Shuo, Cheng Kuang, Xia Yun and Guo Sheng ganged up on each other and were called "Ten Chang Shi." The emperor respected Zhang Rang and called him "Father." The government is not day by day, so that the whole nation psychological chaos, noisy horses bees rise.

The above is "html flexible width layout method" all the content of this article, thank you for reading! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report