Created
December 26, 2019 03:09
-
-
Save kazz12211/93bbbd80b2a554f9bf5faf88053582d5 to your computer and use it in GitHub Desktop.
CSSのみのレスポンシブレイアウト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<link rel="stylesheet" href="css/style.css"> | |
<title>Tsubaki Guitars</title> | |
</head> | |
<body> | |
<div class="loading"> | |
<div class="container"> | |
<h1>Tsubaki Guitars</h1> | |
<h2>Rich tone, playability and fine finish</h2> | |
<a href="#images" class="btn" id="view-works">View works</a> | |
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi fugiat velit sint obcaecati ea dicta architecto enim et molestias, hic quos sapiente reprehenderit consequatur ipsam ipsa tempore repudiandae pariatur excepturi?</p> | |
</div> | |
</div> | |
<div class="main"> | |
<div class="images" id="images"> | |
<div class="image"> | |
<img src="img/ds000.jpg" alt=""> | |
<div class="caption"> | |
<h3>DS</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/fs000.jpg" alt=""> | |
<div class="caption"> | |
<h3>FS</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/l000.jpg" alt=""> | |
<div class="caption"> | |
<h3>L</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/ph000.jpg" alt=""> | |
<div class="caption"> | |
<h3>PH</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/phs000.jpg" alt=""> | |
<div class="caption"> | |
<h3>PH Standard</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/ps000.jpg" alt=""> | |
<div class="caption"> | |
<h3>PS</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/pss000.jpg" alt=""> | |
<div class="caption"> | |
<h3>PS Standard</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
<div class="image"> | |
<img src="img/r000.jpg" alt=""> | |
<div class="caption"> | |
<h3>R</h3> | |
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem, quae.</p> | |
</div> | |
<div class="buttons"> | |
<a href="#" class="btn">Order online</a> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script src="https://code.jquery.com/jquery-3.4.1.min.js" | |
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> | |
<script src="js/main.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url('https://fonts.googleapis.com/css?family=Kosugi+Maru&display=swap&subset=japanese'); | |
body { | |
font-family: 'Kosugi Maru', sans-serif; | |
} | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
.loading { | |
position: absolute; | |
top: 0; | |
left: 0; | |
text-transform: uppercase; | |
height: 400px; | |
} | |
.container { | |
width: 100%; | |
display: flex; | |
flex-direction: column; | |
padding: 80px 40px; | |
} | |
.loading h1 { | |
font-size: 1.5rem; | |
font-weight: bold; | |
margin-bottom: 1.5rem; | |
} | |
.loading h2 { | |
font-size: 1rem; | |
font-weight: bold; | |
margin-bottom: 1rem; | |
} | |
.loading .btn { | |
color: black; | |
text-decoration: none; | |
font-weight: bold; | |
border: 1px solid #000; | |
border-radius: 2px; | |
margin: 10px 0; | |
padding: 10px 10px; | |
text-transform: uppercase; | |
text-align: center; | |
width: 120px; | |
white-space: nowrap; | |
} | |
.loading .btn:hover { | |
background-color: #888; | |
} | |
.main { | |
position: absolute; | |
top: 400px; | |
background-color: black; | |
grid-gap: 10px; | |
} | |
.image { | |
background-color: black; | |
padding: 20px; | |
} | |
.images { | |
display: flex; | |
flex-direction: column; | |
} | |
.image { | |
display: flex; | |
flex-direction: column; | |
} | |
.image img { | |
width: 100%; | |
} | |
.image .caption { | |
padding: 24px; | |
display: flex; | |
flex-direction: column; | |
} | |
.image .caption h3 { | |
color: white; | |
font-weight: bold; | |
} | |
.image .caption p { | |
color: white; | |
} | |
.image .buttons { | |
margin: 10px auto; | |
} | |
.image .btn { | |
color: white; | |
font-weight: bold; | |
background-color: #333; | |
text-decoration: none; | |
border: 1px solid #fff; | |
border-radius: 2px; | |
margin: 10px 0; | |
padding: 10px 10px; | |
text-transform: uppercase; | |
width: 100px; | |
text-align: center; | |
white-space: nowrap; | |
} | |
.image .btn:hover { | |
background-color: #888; | |
} | |
@media screen and (min-width: 375px) { | |
.loading h1 { | |
font-size: 2rem; | |
font-weight: bold; | |
margin-bottom: 1.5rem; | |
} | |
.loading h2 { | |
font-size: 1.2rem; | |
font-weight: bold; | |
margin-bottom: 1rem; | |
} | |
} | |
@media screen and (min-width: 648px) { | |
.loading h1 { | |
font-size: 2.5rem; | |
font-weight: bold; | |
margin-bottom: 2rem; | |
} | |
.loading h2 { | |
font-size: 1.5rem; | |
font-weight: bold; | |
margin-bottom: 1.5rem; | |
} | |
.images { | |
display: grid; | |
grid-template-columns: repeat(2, 1fr); | |
grid-gap: 10px; | |
} | |
} | |
@media screen and (min-width: 1000px) { | |
.loading h1 { | |
font-size: 2.5rem; | |
font-weight: bold; | |
margin-bottom: 2rem; | |
} | |
.loading h2 { | |
font-size: 1.5rem; | |
font-weight: bold; | |
margin-bottom: 1.5rem; | |
} | |
.loading { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 400px; | |
} | |
.main { | |
position: absolute; | |
top: 0; | |
left: 400px; | |
} | |
#view-works { | |
display: none; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment