私はリンクの中にテキストを配置する方法をチュートリアルで探しています。 何も助けになりませんでした。私を助けてくれますか? HTML:縦の整列が機能していませんCSS HTML
<nav>
<a class="but1" href="#"><strong>ART</strong></a>
<a class="but2" href="#"><strong>VIDEOS</strong></a>
<a class="but3" href="#"><strong>ABOUT</strong></a>
<a class="but4" href="#"><strong>CONTACT</strong></a>
</nav>
CSS:
nav a {
font-size: 500%;
text-decoration: none;
color: white;
Height: 25%;
width: 100%;
position:absolute;
text-align: center;
vertical-align: middle;
transform: translate(-50%, -100%);
left: 50%;
}
.but1 {
background-color: #e24e42;
top: 25%;
}
.but2 {
background-color: #e9b000;
top: 50%;
}
.but3 {
background-color: #eb6e80;
top: 75%;
}
.but4 {
background-color: #008f95;
top: 100%;
}
私はWeb開発におけるスターターです。正確に2日になる。巨大な間違いがある場合は、私を判断しないでください。
Googleを検索しましたか? stackoverflowへのリンクを含め、垂直方向のコンテンツ中心のチュートリアルを含むたくさんのサイトがあります。 https://stackoverflow.com/questions/79461/vertical-alignment-of-elements-in-a-div https://stackoverflow.com/questions/396145/how-to-vertically-center-a-div-for - すべてのブラウザ – Charlie
私はそれをgoogleと何も助けなかった。 –