現在,我是一個真正的初學者,剛開始,搞清楚事情,測試並嘗試html和css。我想做出或多或少的東西(見圖片)。我希望它能夠完全縮放以適應瀏覽器/分辨率保持寬高比。初學html/css網站佈局
我的HTML和CSS代碼如下。背景圖像可以很好地縮放,但現在我希望我的導航按照相同的方式縮放。怎麼做?要改變什麼?我也想在實體之下有一條虛線(在導航之上)。有什麼建議? :)剛開始/學習/犯錯:)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>My Layout</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="navigation">
<ul>
<li> <a href="#"> HOME </a></li>
<li> <a href="#"> O MNIE </a></li>
<li> <a href="#"> PORTFOLIO </a></li>
<li> <a href="#"> OFERTA </a></li>
<li> <a href="#"> STREFA ŚLUBNA </a></li>
<li> <a href="#"> PUBLIKACJE </a></li>
<li> <a href="#"> WSPOŁPRACA </a></li>
<li> <a href="#"> BACKSTAGE </a></li>
<li> <a href="#"> KONTAKT </a></li>
</ul>
</div>
</body>
</html>
和CSS:
html
{
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#navigation
{
width: 100%;
height: 60px;
background-color: black;
margin-left: auto;
margin-right: auto;
padding: 0 0 0 0;
position: absolute;
bottom: 0px;
border-top-style: solid;
border-color: white;
border-width: thin;
}
#navigation ul
{
list-style-type: none;
float: right;
margin-left: auto;
margin-right: auto;
}
#navigation ul li
{
float: left;
list-style: none;
margin-left: 18px;
margin-right: 18px;
}
#navigation li a
{
color: #FFF;
text-decoration:none;
font-family: "Calibri";
text-transform:uppercase;
}
#navigation li a:hover
{
text-decoration:none;
color: #F69;
}
#navigation li a:active
{
color: #F69;
}
你期望字體大小能夠縮放嗎? –
您可以在導航中製作另一個邊框並製作邊框樣式:虛線 – IAMTHESTIG
您的問題很模糊,請更清楚地說明實際的實際問題。 –