gpt4 book ai didi

HTML 包装器 Div 标签不起作用?

转载 作者:太空宇宙 更新时间:2023-11-04 12:36:15 24 4
gpt4 key购买 nike

我知道这个问题以前在这个论坛上有人问过,但没有一个答案有帮助,所以我在这里再次提问,我的 html5 和 css 网站有一个包装器(大多数都有),但它没有调整大小内容,我已经检查了我认为可能出错的所有内容,这是所有想尝试查看发生了什么的代码,谢谢!

HTML

<html lang="en">
<head>
<meta charset="utf-8" />
<title>Home</title>
<link rel="stylesheet" href="style.css">
</head>

<body>
<div id="wrapper">


<div id="header">
<ul>
<a href="index.html"><li>Home</li></a>
<li>&nbsp;|&nbsp;</li>
<a href="blog.html"><li>Blog</li></a>
<li>&nbsp;|&nbsp;</li>
<a href="videos.html"><li>Videos</li></a>
<li>&nbsp;|&nbsp;</li>
<a href="#"><li>Contact-Me</li></a>
</ul>

<h1>Zormion's Blog</h1>
</div>


<div id="content">
<h2>Latest Blog Post:</h2>
</div>


<div id="sidebar">
<h3>Tweets:</h3>
<a class="twitter-timeline" href="https://twitter.com/Zormion" data-widget-id="537398875540455424">Tweets by @Zormion</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>


</div>
</body>
</html>

CSS

* {
margin: 0;
padding: 0;
}

body {
background-color: #DFC1B0
}

#wrapper {
margin: 20px auto;
width: 1000px;
text-align: left;
background-color: #CCCCCC;
}

#header {
width: 100%;
height: 40px;
background-color: #000;
}

#header h1 {
margin-left: 10px;
color: white;
}

#header ul {
padding-top: 10px;
float: right;
margin-right: 20px;
}

#header ul li {
display: inline-block;
list-style: none;
color: #fff;
font-size: 16px;
}

#content {
width: 63%;
height: 150px;
background-color: grey;
float: left;
margin: 10px;
padding: 20px;
}

#content h2 {
text-align: center;
font-size: 32px;
}

#sidebar {
width: 25%;
float: left;
background-color: grey;
margin: 10px;
padding: 20px;
border: 1px black;
}

#sidebar h3 {
text-align: center;
color: black;
font-size: 32px;
margin-bottom: 10px;
margin-top: -10px;

}

.twitter-timeline {
height: 500px;
}

最佳答案

像这样使用:

#wrapper {
margin: 20px auto;
width: 100%;
max-width: 1000px;
text-align: left;
background-color: #CCCCCC;
}

关于HTML 包装器 Div 标签不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27254954/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com