djangoのadminで追加したPostをすべて表示させるページで、スクロールバーが表示されません。
環境はchromeです。ウィンドウを拡大、縮小してもバーは表示されませんでした。
css
1.page-header { 2 background-color: rgb(248, 248, 10); 3 font-family: "impact", cursive; 4 padding: 20; 5 top:0; 6 margin: 0; 7 text-align: center; 8 9} 10 11h1 a{ 12 13 font-size: 50px; 14 color:blue ; 15} 16 17#nav{ 18 list-style: none; 19 display: flex; 20 justify-content: space-between; 21 padding: 0; 22 margin: 0; 23} 24#nav li{ 25 background: black; 26 border: solid 1px white; 27 box-sizing: border-box; 28 padding: 15px 0; 29 text-align: center; 30 flex-grow: 1; 31} 32 33#nav li a{ 34 color: white; 35 font-size: 20px; 36 text-decoration:none; 37} 38 39.fixed{ 40 position: fixed; 41 top: 0; 42 left: 0; 43 margin:0; 44 width: 100%; 45} 46 47.post:first-child, .post-detail:first-child{ 48 margin-top:200px; 49} 50 51.post-detail 52{ margin-top:50px; 53 margin-bottom: 50px; 54 padding-bottom:50px; 55 width: 60%; 56 margin-left:40px; 57} 58 59 60.post { 61 margin-top:50px; 62 margin-bottom: 50px; 63 padding-bottom:50px; 64 width: 60%; 65 margin-left:40px; 66 border-bottom: dashed 5px gray; 67} 68 69 70h2 a{ 71 font-size: 36px; 72 color: black; 73 font-family: "Lobster", cursive; 74} 75 76 77 78p{ 79 word-break: break-all; 80} 81 82#text{ 83font-size: 18px; 84} 85 86 87.post-form textarea, .post-form input { 88 width: 60%; 89 90} 91.post-form{ 92padding-left:40px; 93margin-top:20px; 94} 95 96#new_title{ 97margin-top:60px; 98padding-left:40px; 99} 100 101 102#plus-botton{ 103 font-size:80px; 104 position: fixed; 105 bottom:80px; 106 right:120px; 107 color:black; 108 109} 110.glyphicon-plus-sign{ 111 color:black; 112}
base.htmlにすべてのページに共通する部分を書き,それぞれのhtmlでbase.htmlを読み込んでいます。
ですのでPostを全て表示させているhtmlはpost_list.htmlになります。
html
1<!-- 以下 base.html --> 2{% load static %} 3<html> 4 <head lang="ja"> 5 <title>Django Boys blog</title> 6 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> 7 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> 8 <link rel="stylesheet" href="{% static 'css/blog.css' %}"> 9 </head> 10 <body> 11 <div class="fixed"> 12 <div class="page-header"> 13 <h1><a href="/" style="text-decoration:none;">Django Boys Blog</a></h1> 14 </div> 15 <div> 16 <ul id="nav" style="text-decoration:none;" > 17 <li><a href="{% url 'post_list' %}" >記事一覧</a></li> 18 <li><a href="#">人気ランキング</a></li> 19 <li><a href="#">記事の編集</a></li> 20 <li><a href="#">このサイトについて</a></li> 21 </ul> 22 </div> 23 {% block content %} 24 {% endblock %} 25 </body> 26</html> 27
html
1<!-- 以下 post_list.html --> 2{% extends 'blog/base.html' %} 3{% block content %} 4 {% for post in posts %} 5 <div class="post"> 6 <h2><a href="{% url 'post_detail' pk=post.pk %}" style="text-decoration:none;">{{ post.title }}</a></h2> 7 <p id="text">{{ post.text|linebreaksbr }}</pcss> 8 <p>公開日: {{ post.published_date }}</p> 9 </div> 10 {% endfor %} 11 <div id="plus-botton"> 12 <a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus-sign black"></span></a> 13 </div> 14{% endblock %} 15
このように右側に表示されるべきスクロールバーが表示されていません。
cssの部分が読みにくいですが、その部分のアドバイスを含めてスクロールバーが表示されない理由を教えてください。
宜しくお願い致します。
あなたの回答
tips
プレビュー