アプリ版:「スタンプのみでお礼する」機能のリリースについて

Bootstrap のUIキットを利用してWEBサイトを制作しています。
TOPページのスライドショウ画像に文字を乗せているのですが、
スマホや画面の小さいデバイスの際に、文字が消えてしまいます。
絶対配置で配置しているのですが、数値を調整しても文字が表示されません。

<div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
</ol>
<div class="carousel-inner shadow-sm rounded">
<div class="carousel-item active">
<img class="d-block w-100" src="assets/img/type.png" alt="First slide">
<div id="carousel-caption-1st" class="carousel-caption d-none d-md-block">
<h1 class="text-right"><strong>これは</strong><br />
<strong>スライド画像1枚目です。</strong></h1>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/img/park.png" alt="Second slide">
<div id="carousel-caption-2nd" class="carousel-caption d-none d-md-block">
<h1 class="text-right"><strong>これは</strong><br />
<strong>スライド画像2枚目です。</strong></h1>
</div>
</div>
</div>
</div>
CSSはこんな感じです。
数値を調整をしながら表示を試みています。
/*スマホのたての時(表示されない) */
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 20px;
left: 5%;
z-index: 10;
padding-top: 10px;
padding-bottom: 5px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

/*576pxスマホ横(表示されない)*/
@media (min-width: 576px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 10px;
left: 15%;
z-index: 10;
color: #FFF;
text-align: right;

}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 10px;
left: 15%;
z-index: 10;
padding-top: 5px;
padding-bottom: 5px;
color: #FFF;
text-align: right;

}
}

/*768px以上タブレット横(表示されます)*/
@media (min-width: 768px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 250px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 80px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}

/*992x以上PC小型(表示されます)*/
@media (min-width: 992px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 350px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 120px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}

/*1200px以上大型スクリーン(表示されます)*/
@media (min-width: 1200px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 350px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 120px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}
Topの部分を調整すれば表示されるとは思っていたのですが、そうもいかず悩んでいます。
宜しくお願いいたします。

A 回答 (1件)

eccschoolさん



>・・・・・文字が消えてしまいます・・・・・・・・・

単に、Bootstrapを理解しないで使っているだけなんでしょう。

取り敢えず、↓

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>タイトル</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3 … rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv …
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min …
<![endif]-->
<style>
/*スマホのたての時(表示されない) */
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 20px;
left: 5%;
z-index: 10;
padding-top: 10px;
padding-bottom: 5px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

/*576pxスマホ横(表示されない)*/
@media (min-width: 576px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 10px;
left: 15%;
z-index: 10;
color: #FFF;
text-align: right;

}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 10px;
left: 15%;
z-index: 10;
padding-top: 5px;
padding-bottom: 5px;
color: #FFF;
text-align: right;

}
}

/*768px以上タブレット横(表示されます)*/
@media (min-width: 768px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 250px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 80px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}

/*992x以上PC小型(表示されます)*/
@media (min-width: 992px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 350px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 120px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}

/*1200px以上大型スクリーン(表示されます)*/
@media (min-width: 1200px) {
#carousel-caption-1st {
position: absolute;
right: 5%;
top: 350px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}

#carousel-caption-2nd {
position: absolute;
right: 5%;
top: 120px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
text-align: right;
}
}

</style>
</head>
<body>
<div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
</ol>
<div class="carousel-inner shadow-sm rounded">

<div class="carousel-item active">
<img class="d-block w-100" src="https://oshiete.xgoo.jp/images/v2/common/profile … alt="First slide">
<div id="carousel-caption-1st" class="carousel-caption d-block"><!-- d-none d-md-blockを修正 -->
<h1 class="text-right"><strong>これは</strong><br />
<strong>スライド画像1枚目です。</strong></h1>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://oshiete.xgoo.jp/images/v2/common/profile … alt="Second slide">
<div id="carousel-caption-2nd" class="carousel-caption d-block"><!-- d-none d-md-blockを修正 -->
<h1 class="text-right"><strong>これは</strong><br />
<strong>スライド画像2枚目です。</strong></h1>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.1 …
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3 …
</body>
</html>
    • good
    • 0
この回答へのお礼

有難うございました。上記とは違いますが、解決に至りました。

お礼日時:2019/12/22 11:59

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!