タイトルのテキストを画像上に移動したい。画像の下マージンを-50%に変更すると助けになりましたが、テキストは画面のサイズに応じて大きく移動します。画像上でテキストを移動する
.banner{
height: auto;
width: 100%;
max-width: 1200px;
z-index: 1;
text-align: right;
color: white;
margin: none;
bottom margin: none;
}
.title h1{
color: red;
width: 100%;
height:100%;
margin: auto;
z-index: 1;
text-align: center;
text-shadow: black;
float:left;
}
.title p{
color: red;
text-align: center;
float: left;
}
<!DOCTYPE html>
<html>
<head>
<title>Joe's Garage</title>
<link rel="stylesheet" type="text/css" href="Garage CSS">
</head>
<body>
<div class="banner">
<img src="https://static1.squarespace.com/static/562837d1e4b0c53c5afbc078/t/5863246febbd1ab7ab5125b6/1482892406200/slide_405344_5057908_free.jpg?format=1500w">
</div>
<div class="title">
<h1>JOE'S GARAGE</h1>
<p>We Take the Worry Out of Car Trouble by Delivering Accurate Repairs at an Honest Price</p>
</div>
</body>
</html>
あなたは画像の真ん中にタイトルをしたいですか? [flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)でこれを簡単に行うことができます。 –
はい私はそうです!私は今、それを試しましたが、運はありません。 – Ryan