私は<h1>
と<p>
の位置付けに深刻な問題があります。私は現在absolute
ポジショニングを使用していますが、ブラウザのサイズを変更するとテキストが動いてしまいます。見出しと段落のサイズ変更時に
私はそれをスタイルするために他の方法を試しましたが、すべて失敗しました。ここで
はフィドルです:
billboard {
width: 100%;
height: 645px;
position: relative;
background-image: url("../images/billboard.png");
background-repeat: no-repeat;
background-size: contain;
}
.billboard h1 {
color: #fff;
font-family: WCManoNegraBta;
font-size: 100px;
line-height: 60px;
letter-spacing: -4px;
text-transform: capitalize;
width: 100%;
text-align: center;
position: absolute;
top: 250px;
}
.billboard p {
color: #fff;
font-family: Aleo, serif;
font-size: 16px;
letter-spacing: 1px;
width: 100%;
text-align: center;
position: absolute;
top: 325px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" href="http://getbootstrap.com/assets/css/ie10-viewport-bug-workaround.css">
<!-- Custom styles for this template -->
<link href="http://getbootstrap.com/examples/cover/cover.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<link rel="stylesheet" href="http://getbootstrap.com/assets/js/ie-emulation-modes-warning.js">
<div class="billboard">
<h1>resto</h1>
<p>Where your taste meets our perfectionism</p>
</div>
私にとっては見知らぬ人は何である提案フィドルに、それは完璧に動作していることである。ここでは
はスタイルが更新されます。私のコードでは、テキストはビューポートに縮小されていません。 –これは、 'position:absolute;'を使用していると間違いなく間違っています。あなたは何を達成しようとしていますか?あなたの質問に明示してください。 – connexo