このサイト( http://datsumousyou.starfree.jp/ )を作りました。
うまくレスポンシブ対応できてません。
TOP画面なんですが、widthを100%にしてるのですが、横スクロールできてしまって、そうしないと画像が収まらなくなっています。
他のページみたいに、縦スクロールだけで見れるように、収まるようにしたいです。
いろいろ模索したり検索したのですが、できませんでした。詳しい方回答よろしくお願いします。
該当サイトのHTML及びCSSの記載をお願いします。
コメントありがとうございます。よろしくお願いします。
HTML
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<title>多発・蛇行型 円形脱毛症から3年で回復した私がやったこと</title>
<link href="https://fonts.googleapis.com/css?family=Bitter:400,700" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body id="index">
<!-- header始まり -->
<header>
<div class="logo">
<a href="index.html"><img src="images/logo.png" alt="ホーム"></a>
</div>
<nav>
<ul class="global-nav">
<li><a href="hazimeni.html">First</a></li>
<li><a href="genin.html">Cause</a></li>
<li><a href="meneki.html">To do 1</a></li>
<li><a href="taion.html">To do 2</a></li>
<li><a href="zikosyoukai.html">About</a></li>
</ul>
</nav>
</header>
<!-- header終わり -->
<!-- wrap始まり -->
<div id="wrap">
<div class="content">
<h1>多発・蛇行型<br>円形脱毛症から<br>3年で回復した私がやったこと</h1>
<p>このWebサイトは、多発・蛇行型の円形脱毛症になった私が、<br>いろいろ調べたことや、治すために取り入れた様々なことをまとめたサイトです。</p>
</div>
</div>
<!-- wrap終わり -->
<!-- footer始まり -->
<footer>
<small>(C)2019 Nishida-studio.</small>
</footer>
<!-- footer終わり -->
</body>
</html>
ーーーーーーーーーーーーーーーーーーーーーーーーーーーー
css
@charset "utf-8";
body {
margin: 0;
padding: 0;
background-color: #cccccc;
color: #333333;
font-size: 15px;
line-height: 2;
}
header {
width: 960px;
height: 100px;
margin: 0 auto;
}
.logo {
float: left;
margin-top: 50px;
}
.logo img{
width: 150px;
height: 110px;
}
.global-nav {
float: right;
margin-top: 90px;
}
.global-nav li {
float: left;
margin: 0 20px;
font-size: 20px;
list-style: none;
font-family: 'Bitter', serif;
}
.global-nav li a {
color: #ffffff;
}
.global-nav li a:hover {
border-bottom: 2px solid #ffffff;
padding-bottom: 3px;
text-decoration: none;
}
#wrap {
clear: both;
background-color: #ffffff;
margin-top: 220px;
padding: 35px 0;
}
.content {
width: 960px;
margin: 0 auto;
}
footer {
text-align: center;
color: #ffffff;
padding: 20px 0;
background-color: #767671;
}
footer small {
font-size: 12px;
}
#index h1 {
font-size: 100px;
line-height: 1;
color: #ffffff;
font-family: 'Bitter', serif;
margin-bottom: 50px;
border: none;
}
#index .content {
margin-top: 150px;
}
#index p {
font-size: 16px;
color: #ffffff;
}
#index footer {
width: 960px;
margin: 150px auto 0 auto;
text-align: left;
background-color: transparent;
}
#index {
background-image: url(../images/bg-index.jpg);
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
background-size: cover;
}
#index #wrap {
background-color: transparent;
margin-top: 0;
padding: 0;
}
@media screen and (max-width:600px) {
/* 画面サイズが600px以下の場合に適用 */
#index {
background-image: url(../images/forSp.jpg);
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
background-size: 100%;
}
body {
font-size: 3.5vw;
}
h1 {
font-size: 7.2vw;
}
#index h1 {
font-size: 21vw;
}
header {
width: auto;
margin: 0.5%;
}
.logo {
float: none;
margin-top: 10px;
text-align: center;
}
.global-nav {
float: none;
margin-top: 10px;
text-align: center;
}
.global-nav li {
display: inline;
float: none;
margin: 0 8px;
}
#wrap {
margin-top: 100px;
padding: 35px 0 0;
}
.content {
max-width: 100%;
}
ーーーーーーーーーーーーーーーーーーーーーーーーーー
です。長くて読むだけで大変だと思いますが、よろしくお願いします。
コードはコメント欄ではなく、本文に各コードブロックとして提示されると良いです。

回答1件
あなたの回答
tips
プレビュー