このphotoに表示される浮動小数点要素をどのように配置することができますか?私はそれをウェブページの左から真ん中に持っていきたいが、それをページの一番上に置いておきたいのですか?ここで CSSで浮動小数点要素をどのように配置することができますか?
は、HTMLのコードです:<html>
<head>
<title>Batch File Generator | Home</title>
</head>
<link href="style.css" rel="stylesheet" >
<ul>
<li><a>Home</a></li>
<li><a>Download</a>
<ul>
<li><a href="32-bit version.exe" download="download">32-bit version</a></li>
<li><a href="64-bit version.exe" download="download">64-bit version</a></li>
</ul>
</li>
<li><a>Discussion</a>
<ul>
<li><a>Community forums</li></a>
<li><a>Ask the developers</li></a>
</ul>
</li>
<li><a>News</a></li>
</ul>
</html>
をそしてここでCSSのコードです:
body{
background: url("background.jpg") no-repeat;
background-size: cover;
font-family: Arial;
color: white;
}
ul{
margin: 0px;
padding: 0px;
list-style: none;
}
ul li {
float: left;
width: 200px;
height: 40px;
background-color: black;
opacity: .8;
line-height: 40px;
text-align: center;
font-size: 20px;
}
ul li a {
text-decoration: none;
color: white;
display: block;
}
ul li a:hover {
background-color: green;
}
ul li ul li {
display: none;
}
ul li:hover ul li {
display: block;
}
なぜあなたはそれを左に浮くでしょうか?フローティングを削除し、余白を追加する:0自動; –
ありがとう。 "これを書く必要がありますが、私はコメントを公開できません。"それは短すぎます... " – ange
Dawid Zbinskiドロップダウンメニューで" margin:0 auto; "白い筆記はページ上部の中央にありますが、縦に整列されており、ドロップダウン効果は働きません。 – ange