###前提・実現したいこと
divのitemsクラスで囲んだ部分が縦に並ばない。
col-xs-8とcol-xs-4を使い画面を8:4に分けてその4の部分に画像を縦に並べたい。
###発生している問題・エラーメッセージ
htmlに
<div class="items col-xs-4"> <div class="flex-item"><a href="https://wwwwwwwwww" target="_blank" rel="nofollow"> <img border="0" width="250" height="250" alt="" src="https://yyyyyyyyyyy"></a> <img border="0" width="1" height="1" src="https://wwweeeeeeeee" alt=""></div> </div> <div class="items col-xs-4"> <div class="flex-item"><a href="https://zzzzzzzzzzzzzzzzzzzzz" target="_blank" rel="nofollow"> <img border="0" width="350" height="240" alt="" src="https://wwwxxxxxxxxxxxxxx"></a> <img border="0" width="1" height="1" src="https://wwwqqqqqqqqqq" alt=""></div> </div> <div class="items col-xs-4"> <div class="flex-item"><a href="https://qqqqqqqqqqqqq" target="_blank" rel="nofollow"> <img border="0" width="300" height="250" alt="" src="https://wwwllllllllllll"></a> <img border="0" width="1" height="1" src="https://wwweeeeeeeeeee" alt=""></div> </div>
と書いたitemsクラスを縦に並べたい。しかし、今は横に並んでいる。
###該当のソースコード
html全体には
{% load static%} <html lang="ja"> <head> <meta charset="UTF-8"> <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet"> <link rel="stylesheet" href="{% static 'detail.css' %}"> <link rel="stylesheet" href="{% static 'bootflat/css/bootflat.min.css' %}"> <title>WEB SITE</title> </head> <body class="relative"> {% include '../header.html' %} <main> <div class="container"> <div class="detailimg col-xs-8"> <div class="relative_ele"> <img class="absolute-fill" src="{% static 'accounts/detail.jpg' %}" width="500px" height="300px" alt="詳細" /> <div class="absolute-fill vertical-center-container"> <p class="hthree">XOXO</p> <p class="hthree_small">I LOVE YOU<br>I MISS YOU</p> </div> </div> <a class="button-primary" href="send">SEND</a> <a class="button-primary" href="see">SEE</a> <a class="button-primary" href="know">KNOW</a> </div> <div class="items col-xs-4"> <div class="flex-item"><a href="https://wwwwwwwwww" target="_blank" rel="nofollow"> <img border="0" width="250" height="250" alt="" src="https://yyyyyyyyyyy"></a> <img border="0" width="1" height="1" src="https://wwweeeeeeeee" alt=""></div> </div> <div class="items col-xs-4"> <div class="flex-item"><a href="https://zzzzzzzzzzzzzzzzzzzzz" target="_blank" rel="nofollow"> <img border="0" width="350" height="240" alt="" src="https://wwwxxxxxxxxxxxxxx"></a> <img border="0" width="1" height="1" src="https://wwwqqqqqqqqqq" alt=""></div> </div> <div class="items col-xs-4"> <div class="flex-item"><a href="https://qqqqqqqqqqqqq" target="_blank" rel="nofollow"> <img border="0" width="300" height="250" alt="" src="https://wwwllllllllllll"></a> <img border="0" width="1" height="1" src="https://wwweeeeeeeeeee" alt=""></div> </div> </div> </main> <footer> <div class="footers"> <ul class="bottom-menu"> <li class="bottom-menu-item"><a class="bottom_index" href="">ご利用規約とプライバシポリシー</a></li> </ul> </div> </footer> </body> </html>
cssには
* { margin: 0; padding: 0; } ul { display: flex; } .flex-item { width: 100%; } .half-width { width: 50%; } .title { color: white; font-size: 70px; align-self: center; } .top-menu-item{ list-style: none; font-size: 17px; } main { display: flex; } main div.detailimg { margin: 30px; } .white-letter { color: white; } .right-position { width: 100%; } .float-left { float: left; } .btn btn-primary btn-lg { background-color: black; } .outer { display: flex; justify-content: center; align-items: center; } .items{ display: flex; width:400px; height:300px; align-items: flex-start; } .flex-item{ flex-flow: column nowrap; margin: 20px 30px; } .relative_ele{ position: relative; height:300px } .absolute-fill { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; } .vertical-center-container { display: flex; flex-direction: column; justify-content: space-around; } .hthree { color: white; font-size: 30px; padding-top:70px; padding-left:8px; font-weight: bold; } .hthree_small { color: white; font-size: 20px; padding-left:30px; margin-top:0px; margin-left:0px; } .button-primary { display: inline-block; width: 300px; height: 45px; font-size: 20px; background-color: black; color: white; text-align: center; padding: 5px 0px; margin: 10px 0px; border-radius: 6px; } footer{ height: 50px; width: 100%; background-color: black; position:absolute; bottom:0; } .footers{ background-color: pink; position:absolute; bottom:0; } .relative { position: relative; } .bottom-menu-item{ list-style: none; font-size: 15px; } .bottom_index { color: white; padding-left: 30px; }
と書いた。
###試したこと
CSSのitemsに
align-items: flex-start; の代わりに
justify-content: flex-start; ・ justify-content: flex-end;
と指定したがitemsの要素は縦に並ばなかった。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/10/14 14:16
2017/10/14 14:28 編集
2017/10/14 14:35
2017/10/14 14:41
2017/10/14 14:44
2017/10/14 14:50 編集
2017/10/14 15:05