男が私のためにウェブサイトを作ってくれたので、私はそれを理解しようとしています. ここにあります: http://www.brilliantzenaudio.com
左上にロゴ画像があることに注意してください。これがどこから来たのか理解しようとしています。関連するコードは、一部が header.php に、一部が app.css にあるようです。header.php から、
<header class="banner" role="banner">
<div class="container">
<div class="row">
<div class="col-xs-12 col-lg-2">
<h1 class="logo"><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?>">Brilliant Zen Audio</a></h1>
... stuff removed here, other items in header ...
</div>
</div>
</div>
</header>
また、app.css には次のような行が含まれています。上記の php を見ると、「banner」クラスの要素があることがわかります。そのため、それをアドレス指定する css コードがあることは明らかです (色、位置、境界線、および z-index を指定します)。また、ヘッダータグにも「バナー」という「役割」が与えられていることがわかります。それは当面の目的に役立ちますか、それともスクリーンリーダー用ですか?
また、php には h1 要素が含まれており、'h1' 要素内に 'a' 要素が含まれていることもわかります。CSS エントリはそれらのもののためにあります。彼らの目的が何なのかはっきりしない。一つには、ロゴはイメージです。なんでh1タグつけてるの?ロゴは (ホームページに戻るために) クリックできるようにする必要があるため、タグの必要性を理解しています。しかし、リンクのテキストとして配置されるものは次のとおりです (そこで PHP を解析する方法については明確ではありません。賢いのは、「h1.logo a」CSS エントリの背景であるため、画像がそこに配置されることです。 .
以下のコメントにいくつかの一般的な質問を追加しました。
.banner { }
header.banner {
background:#603913;
position:relative; // question: what does this mean and how will it effect the position of things if I start moving or changing elements?
border-bottom:solid 1px #fff; // question: is this bottom border important for some reason?
z-index:9999; // what does this do?
}
h1.logo {
margin:0; // is there a need to define these on h1.logo?
padding:0;
}
h1.logo a {
display:block; // what is display:block and how does it affect appearance? How would it affect changes if I change the size or location of the logo?
text-indent:-9999px; // what is this?
background:url(../img/sm-logo.png) no-repeat 0 0;
width:101px; // what does it mean when you set the width and height of an <a>
height:103px;
margin:0 auto;
}