今の状況と解決したいこと
ruby on rails, bootstrapを使ってブログアプリを作成しています。
ブログ一覧のcontentの中身が表示されなくなってしまいました。(最初は表示されていた)
一覧のソースコードは以下の通りです。
<div class="list"> <p id="notice"><%= notice %></p> <h1>Murmurs List</h1> <div> <table class="table"> <thead> <tr> <th>Content</th> <th colspan="3"></th> </tr> </thead> <tbody> <% @murmurs.each do |murmur| %> <tr> <td><%= murmur.content %></td> <td><button type="button" class="btn btn-outline-warning"><%= link_to 'Show', murmur %></button></td> <td><button type="button" class="btn btn-outline-info"><%= link_to 'Edit', edit_murmur_path(murmur) %></button></td> <td><button type="button" class="btn btn-outline-danger"><%= link_to 'Destroy', murmur, method: :delete, data: { confirm: 'Are you sure?' } %></button></td> </tr> <% end %> </tbody> </table> <div> <br> <button type="button" class="btn btn-warning"><%= link_to 'New Murmur', new_murmur_path %></button> </div>
試したこと
topページの文字も消えてしまったのですが、そちらは<p>タグを<h6>タグに変えることで解決できました。
しかしテーブルは代替タグが思いつかず…
調べたところ、cssで背景色を設定しているか、bodyのwidthがautoになっていると同じ現象が出るとわかりました。
確認してみましたが、その条件には当てはまらないみたいなので他に原因があるのかと思うのですが。。
以下がcssのコードです。
header { width: 100%; background-color: #66BAB7; height: 54px; } header ul { margin: 0 auto; list-style: none; } header .a { display: block; padding: 15px; text-decoration: none; color: orange; } header li { float: left; width: auto; } header ul:after { content: ""; display: block; clear: both; } footer { width: 100%; background-color: #66BAB7; padding: 20px 0 10px 0; color: white; margin: 0; padding-bottom: 10px; font-size: 12px; position: absolute; bottom: 0; } html { position: relative; min-height: 100%; } body { text-align: center; } .main-header { padding: 20%; width:100%; background-size: cover; background-image: url("main-header.jpg"); background-attachment: fixed; } .main-header img { display: block; margin: 0 auto; width: 25%; padding-top: 15%; } .list, .new, .about { padding: 10%; } .table { text-align: center; } h4, h5 { color: #64363C } h6 { line-height: 25px; }
初心者の拙い質問で恐縮ですが、どなたか知恵をお貸しください(><)
回答2件
あなたの回答
tips
プレビュー