##現在の問題点
CSSとHTMLを用いて次のようなページを書きましたが、画像が真ん中に来ないで左に寄ってしまいます。
どこを修正すればよいかご教授ください。
##問題のソース
html
1<!DOCTYPE html> 2<html lang="ja"> 3 <head> 4 <meta charset="UTF-8"> 5 6 <link rel="stylesheet" 7 href="{% static 'css/bootstrap.min.css' %}"> 8 9 10 11 </head> 12 <body> 13 <style> 14 .full-width { 15 width: 100vw; 16 position: relative; 17 left: 50%; 18 right: 50%; 19 margin-left: -50vw; 20 margin-right: -50vw; 21 background-color: red; 22 } 23 24 .top_b1 { 25 width: 1080px; 26 } 27 28 center{ 29 text-align: center; 30 } 31 32 .resizeimage img { width: 100%; } 33 34 </style> 35 <div class="container"> 36 37 <div class="full-width"> <!--親無視--> 38 <div class="top_b1"> <!--画像の親--> 39 <div class="resizeimage"><!--画像サイズ可変--> 40 <div class="center"> 41 <img src="./hogehoge.png" alt="紹介画像1" > 42 43 </div> 44 </div> 45 </div> 46 47 </div> 48 いろいろ 49 </div> 50 </body> 51</html> 52 53 54
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/08 22:12