https://stackoverflow.com/questions/13568693/collapsed-wesite-template-when-i-mininize-the-browser。对不起我之前的无意义的问题。
我有一个 100% 宽度的 HTML 网站模板。该网页在完整的浏览器窗口中正确显示。但是我改变浏览器窗口的大小意味着整个设计都崩溃了。我认为故障在于 css html 和 body 标签。任何人都可以解决此错误。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>title</title>
<link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" />
</head>
<body>
<header id="header">
<hgroup>
<h1 class="site_title"><a href="index.html">Admin</a></h1>
<h2 class="section_title">Dashboard</h2><div class="btn_view_site"><a href="">View </a></div>
</hgroup>
</header> <!-- end of header bar -->
<section id="secondary_bar">
<div class="user">
<p>John Doe (<a href="#">3 Messages</a>)</p>
<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
</div>
<div class="breadcrumbs_container">
<article class="breadcrumbs"><a href="index.html">Admin</a> <div class="breadcrumb_divider"></div> <a class="current"></a></article>
</div>
</section><!-- end of secondary bar -->
CSS:
html, div, map, dt, isindex, form, header, aside, section, section, article, footer {
display: block;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
background: #F8F8F8;
font-size: 12px;
}
.clear {
clear: both;
}