Home > Web Front-end > HTML Tutorial > Newcomers please help_html/css_WEB-ITnose

Newcomers please help_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:56:54
Original
861 people have browsed it

How can I keep the web page I designed from changing as the window changes? . .


Reply to discussion (solution)

margin:auto;

Try to use percentages when setting position or width

It depends on how you want to display your page.
1. If you want your page to change with the size of the window, it is a dynamic layout, which means you need to write the width attribute of the page as a percentage.
2. If you don’t want your page to change according to the change of your window, just set the overall width of the page and center it.

Use adaptive layout. responsive layout

<div style="width:950px;margin:0 auto"><div style="background:#09F;float:left;width:400px">44444444444444</div><div style="background:red">33333333333333</div><div style="background:#F30;float:left;width:600px">22222222222222</div><div style="background:#FFF">11111111111111</div></div>
Copy after login


table layout can be achieved

<table style="width:100%;height:100%"></table>
Copy after login

for pages that do not want to be changed The element uses CSS to fix the width and height so that the layout will not be messy when the window changes. However, if the window is too small, scroll bars will appear

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template