見出し画像

HTMLにてレスポンシブに対応したのを制作

<!DOCTYPE html>
<html lang="ja">

<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <link rel="stylesheet" href="css/style.css">
 <title>イヤホンジャックの向こう側</title>
</head>

<body>
 <div class="containar">
   <header>
     <h1>COCOA</h1>
   </header>
   <div class="content">
     <section class="information">
       <h1>イヤホンジャックの向こう側</h1>
       <p class="type">Album</p>
         <div class="descripstion">
           <a href="#"><img src="img/jacket.png" alt="イヤホンジャックの向こう側のCDジャケットの写真"></a>
           <p>COCOA 4枚目のアルバムとなる今作。ジャケットデザインに色鉛筆画家の「カタヒラシュンシ」氏を迎え、音楽と絵のコラボを実現させた一枚。</p>
           <p>HONDA CARS 静岡CM タイアップの「キミのうた」をはじめ、完全書き下ろしの新曲3曲を含む全6曲を収録。<br>
           イヤホンジャックの向こう側に広がる世界を、ぜひご堪能ください。</p>
         </div>
     </section>
     <section class="songs">
       <h2>収録曲</h2>
       <ol class="clearfix">
         <li><a href="https://www.youtube.com/watch?v=vjqTkOISzeY" target="_blank">c#</a></li>
         <li>ワンルームファッションショー</li>
         <li>ハッピータイム</li>
         <li>シャンディガフ</li>
         <li>僕は知らない</li>
         <li>キミのうた</li>
       </ol>
     </section>
   </div>
   <footer>
     &copy; 2020 COCOA
   </footer>
 </div>
</body>

</html>
@import url(sanitize.css);
@import url('https://fonts.googleapis.com/css2?family=Sriracha&display=swap');

body {
 background-color: #f0f0f0;
 padding: 10px;
 font-size: 14px;
 color: #666;
}

.containar {
 max-width: 800px;
 box-shadow: 0 0 10px rgba(0,0,0,.3);
 margin: 0 auto;
}

header {
 background-color: #422814;
 padding: 10px;
 color: #fff;
}


header h1 {
 margin: 0;
 font-size: 24px;
 font-weight: normal;
 text-align: center;
 font-family: 'Sriracha', cursive;;
}


.descripstion {
 clear: left;
}

.descripstion img {
 float: left;
 margin: 0 10px 10px 0;
 transition-property: opacity;
 transition-duration: 1s;
 transition-timing-function: ease;
 transition-delay: 0s;
}

.descripstion img:hover {
 opacity: .5;
 
}

.information h1 {
 font-size: 18px;
 margin: 0 10px 10px 0;
 float: left;;
}

.information .type {
 display: inline;
 background-color: #e35a4d;
 padding: 3px 5px;
 font-size: 80%;
 color: #fff;
}

.content {
 background-color: #fff;
 padding: 20px;
}
.songs {
 margin: 0 0 20px;
}
.songs h2 {
 clear: left;
 font-size: 100%;
 font-weight: normal;
 margin: 0;
 background-color: #e6e4dd;
 padding: 5px 10px;
}

.songs  ol {
 padding: 0;
 margin: 0;
 list-style: decimal inside;
}

.songs li {
 border-bottom: 1px solid #ccc;
 width: 50%;
 float: left;
 padding: 5px 10px;
}

.clearfix::after {
 content: "";
 display: block;
 clear: both;
}

a {
 color: #666;
}

footer {
 text-align: center;
 font-size: 80%;
}

@media only screen and (max-width: 600px) {
   .descripstion  img {
     float: none;
     display: block;
     margin: 0 auto;
   }
   header {
     padding: 5px;
   }
   header h1 {
     font-size: 12px;
   }
   .information h1 {
     font-size: 14px;
   }
 .songs li {
 float: none;
 width: inherit;
 }
}

この記事が気に入ったらサポートをしてみませんか?