我想为我的页面做一个响应式设计,我已经做了布局,它在调整大小时工作得很好,但是当我在我的页面中添加文本然后调整它的大小时,事情变得一团糟。这是因为布局正在相应地调整自己的大小,但文本并没有自行调整大小。它将如何解决?
这是html代码:
<body>
<div id="mainpage">
<div id="menu">
<div id="menuhomepage"><a href="#"></a></div>
<div id="menublog"><a href="#"></a></div>
<div id="menuphoto"><a href="#"></a></div>
<div id="menuabout"><a href="#"></a></div>
<div id="menulinks"><a href="#"></a></div>
<div id="menucontact"><a href="#"></a></div>
</div>
<div id="header">
<div id="headertext"><a href="#">logologo</a></div>
</div>
<div id="content">
<div id="articles"></div>
<div id="sidebar">
<div id="searchbar"></div>
<div id="tempus"></div>
<div id="categories"></div>
<div id="blogroll"></div>
<div id="archieve"></div>
</div>
</div>
</div>
<div id="footer"></div>
</body>
这是CSS代码:
body
{
background-image: url(images/background.jpg);
min-height: 1000px;
background-repeat: repeat-x;
background-color: #DBE2D0;
width: 100%;
margin: 0%;
font-size: 100%;
min-width: 150px;
}
#mainpage
{
width: 80%;
min-height: 900px;
margin-left: 10%;
}
#menu
{
width: 100%;
height: 60px;
}
#menuhomepage
{
background-color: #5D7144;
width: 30%;
height: 60px;
float:left;
}
#menuhomepage a
{
text-decoration: none;
color: White;
margin-left: 60%;
margin-bottom: 10px;
}
#menublog
{
background-color: #5D7144;
width: 10%;
height: 60px;
margin-left: 0.1%;
float: left;
}
#menuphoto
{
background-color: #5D7144;
width: 15%;
height: 60px;
margin-left: 0.1%;
float: left;
}
#menuabout
{ background-color: #5D7144;
width: 10%;
height: 60px;
margin-left: 0.1%;
float: left;
}
#menulinks
{
background-color: #5D7144;
width: 10%;
height: 60px;
margin-left: 0.1%;
float: left;
}
#menucontact
{
background-color: #5D7144;
width: 24.5%;
height: 60px;
margin-left: 0.1%;
float: left;
}
#header
{
height: 170px;
}
#header a
{
text-decoration: none;
font-size: 40pt;
color: White;
}
#headertext
{
padding-left: 40%;
padding-top: 5%;
}
#content
{
background-color: White;
min-height: 1600px;
}
#articles
{
width: 60%;
border: 2px solid Gray;
min-height: 1400px;
margin-left: 5%;
margin-top: 50px;
float: left;
}
#sidebar
{
width: 25%;
border: 2px solid Gray;
min-height: 1400px;
margin-left: 5%;
margin-top: 50px;
float: left;
}
#searchbar
{
width: 96%;
border: 2px solid Gray;
min-height: 150px;
margin-left: 1%;
margin-right: 1%;
margin-top: 10px;
float: left;
}
#tempus
{
width: 96%;
border: 2px solid Gray;
min-height: 100px;
margin-left: 1%;
margin-right: 1%;
margin-top: 30px;
float: left;
}
#categories
{
width: 96%;
border: 2px solid Gray;
min-height: 350px;
margin-left: 1%;
margin-right: 1%;
margin-top: 10px;
float: left;
}
#blogroll
{
width: 96%;
border: 2px solid Gray;
min-height: 350px;
margin-left: 1%;
margin-right: 1%;
margin-top: 10px;
float: left;
}
#archieve
{
width: 96%;
border: 2px solid Gray;
min-height: 350px;
margin-left: 1%;
margin-right: 1%;
margin-top: 10px;
float: left;
}
#footer
{
background-image: url(images/footer.png);
width: 100%;
height: 200px;
margin-top: 50px;
margin-left: 0px;
}
在此处检查 jsfiddle 代码:http: //jsfiddle.net/2NNNy/
在添加“logologo”文本并调整大小时,字体大小没有调整大小,为什么?