Html 根据内容展开div

Html 根据内容展开div,html,css,expand,Html,Css,Expand,我试图使页面的contentdiv根据脚本加载的内容进行扩展。我已经尝试了我所知道的一切和在互联网上找到的一切,但没有任何结果是我想要的 HTML: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>index</title> <link href="styles.css" rel="styleshe

我试图使页面的contentdiv根据脚本加载的内容进行扩展。我已经尝试了我所知道的一切和在互联网上找到的一切,但没有任何结果是我想要的

HTML:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>index</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function(){
$('#nav a').click(function(e) {
$('#content').hide().load( $(this).attr('href') , function(){
$('#content').show()
})
return false
})
})
</script>
</head>
<body>
<div id="container">
  <div id="header"></div>
  <div id="nav"><a href="home.html">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <a href="the_band.html">The Band</a>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp; 
  <a href="News.html">News</a> &nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <a href="gallery.html">Gallery</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Merchandise&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <a href="contact.html">Contact</a></div>
  <div id="content"></div>
  <div id="footer"></div>
</div>
</body>
</html>
演示链接是:


现在,出现的问题是,加载的内容不会使内容扩展,但似乎会加载到它上面。。。有什么想法吗?

如果你想让你的页面具有响应性,你最好使用引导,因为使用网格系统可以让你的页面根据内容和屏幕大小做出响应

你可以得到它


下面是一些免费模板,向您展示了如何将所有内容组合在一起

我看到没有任何内容加载到页面中…?$'content'.hide.load$this.attr'href',function{$'content'.show};没有加载任何内容。。我不确定绝对定位的div是否可以随位置值扩展。打开我正在编写的演示链接,单击新闻,你就会明白我的意思。
div#container {
height: 100%;
width: 100%;
}
div#header {
top: 0px;
width: 100%;
height: 80px;
position: fixed;
background-color: transparent;
text-align: center;
}
div#nav {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
top: 120px;
width: 100%;
height: 40px;
position: fixed;
text-decoration: none;
text-align: center;
font-weight: bolder;
font-variant: normal;
}
div#content {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 12px;
position: absolute;
top: 200px;
bottom: 40px;
left: 200px;
right: 200px;
}
div#footer {
font-family: Arial, Helvetica, sans-serif;
font-size: 9px;
bottom: 0px;
position: fixed;
height: 30px;
width: 100%;
text-align: center;
color: #fff;
}
.ttdesign {
font:"Arial Black", Gadget, sans-serif; color: #09F;
}
a:link {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
}
a:visited {
font-family: MgSouvenirLight;
font-size: 18pt;
color: #FF0;
}
a:hover {
font-family: MgSouvenirLight;
font-size: 18pt;
font-style: italic;
color: #FC0;
}