I m stuck, I am designing a webpage on resolution 1266px. I want it to fit on 1024px because 13% of the people are still using that resolution. So I thought I could change the fontsize of my h1 and my nav_items.
因此,如果决议低于1260,它们将合身,我希望它们留在给他们的固定纸条上。
这就是我得到的:
header {
width:100%;
background: #222;
color: white;
height: 80px;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
-webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
text-shadow: 2px 2px 0 #000;
}
header h1 { /* TAVERNE DE STADSPOORT */
font-size: 40px;
float:left;
color:white;
margin: 0px 0px 0px 0px; /* top, left, bottom, right*/
padding: 10px 30px 10px 20px; /* top, right, bottom, right*/
}
header ul {
float: right;
width: 680px;
padding: 20px; 0px; 0px; 0px; /* top, left, bottom, right*/
}
.nav_items li {
display:inline;
font-size:22px;
margin: 0px 4px 0px 4px; /* top, left, bottom, right (outside) */
padding: 0px 4px 0px 4px; /* top, left, bottom, right*/
}
<div id="logo">
<h1 class="nav_items"><a href="index.html">Taverne De Stadspoort</a></h1>
</div>
<nav id="top">
<ul class="nav_items">
<li><a href="/">Menukaart</a></li>
<li><a href="/">Suggesties</a></li>
<li><a href="/">Onze wijnen</a></li>
<li><a href="/">Ligging/contact</a></li>
<li><a href="/">Gastenboek</a></li>
</ul>
</nav>
Maybe I did something wrong, and I could resolve this problem a other way. Or should I use jquery instead for archieving this? since I am not familair with that an other solution would be great.
i 添加以下内容:
@media all and (max-width: 1259px) { h1 { font-size: 25px; } }
@media all and (min-width: 1260px) { h1 { font-size: 40px; } }
/* http://www.w3.org/TR/css3-mediaqueries/ */