いつもお世話になってます。
質問は表題の通りです。
topber要域の後にafterでコメントを付けたいのですが、なぜか表示されません。
imgに被ってしまっているのかとimgタグを外してみたのですが、表示されませんでした。
レイアウトをグリッドレイアウトにしているので、その場合はafterは使えないのかと思いましたがどうでしょうか?
コードは下記の通りです。
その他必要情報がありましたら追記いたしますのでおっしゃってください。
宜しくお願いします。
追記です。
ブラウザはchromeです。宜しくお願いします。
html
1<!DOCTYPE html> 2<html> 3<head> 4 <meta charset="UTF-8"> 5 <title>grid</title> 6 <link rel="stylesheet" type="text/css" href="css/style.css"> 7 <script type="text/javascript" src="js/jquery.js"></script> 8 <script> 9 $(function(){ 10 11 }) 12 13</script> 14</head> 15 16<body> 17 18<div id="grid"> 19 20<div class="topber"> 21<img src="img/201805_marathon_honban_03_func_950x50.gif" /> 22</div> 23 24 25<div class="header"> 26 header 27</div> 28 29<div class="contents"> 30 contents 31</div> 32 33<div class="footer"> 34 footer 35</div> 36 37 38</div><!-- grid閉じタグ --> 39 40</body> 41</html> 42
css
1@charset "UTF-8"; 2/*---Reset---*/ 3body, h1, h2, h3, h4, h5, h6, p, address, 4ul, ol, li, dl, dt, dd, img, form, table, tr, th, td { 5 margin: 0; 6 padding: 0; 7 border: none; 8 font-style: normal; 9 font-weight: normal; 10 font-size: 100%; 11 text-align: left; 12 list-style-type: none; 13 border-collapse: collapse; 14} 15 16textarea { 17 font-size: 100%; 18 vertical-align: middle; 19} 20 21img { 22 border-style: none; 23 display: block; 24} 25 26hr { 27 display: none; 28} 29 30em { 31 font-style: normal; 32} 33 34input { 35 line-height: auto; 36 vertical-align: middle; 37} 38 39strong.more { 40 color: #c30; 41} 42 43a { 44 text-decoration: none; 45} 46 47body { 48 font-family: 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif; 49} 50 51/*クラス定義*/ 52.clearfix:after { 53 content: "."; 54 display: block; 55 clear: both; 56 height: 0; 57 visibility: hidden; 58} 59 60.clearfix { 61 display: inline-table; 62} 63 64/* Hides from IE-mac */ 65* html .clearfix { 66 height: 1%; 67} 68 69* + html .clearfix { 70 min-height: 1%; 71} 72 73.clearfix { 74 display: block; 75} 76 77/* End hide from IE-mac */ 78* { 79 -webkit-box-sizing: border-box; 80 -moz-box-sizing: border-box; 81 -o-box-sizing: border-box; 82 -ms-box-sizing: border-box; 83 box-sizing: border-box; 84} 85 86#grid { 87 display: grid; 88 grid-template-columns: 1fr; 89 /*これが基準になる */ 90 grid-template-rows: 1fr 1fr 1fr 1fr; 91 grid-template-areas: "topber" "header" "contents" "footer"; 92 border: 1px solid #2f2ec1; 93} 94 95.topber { 96 grid-area: topber; 97 background-color: #357772; 98} 99 100.topbar:after { 101 content: "サンプルサンプルサンプル"; 102 color: #40c6d9; 103 font-size: 30px; 104} 105 106.topber img { 107 margin: 0 auto; 108} 109
回答1件
あなたの回答
tips
プレビュー