現在Ruby_on_railsを使用していますが、その中のVIEWを見栄えが良くなる様にしています
今の画面は・・・・・下記になります
未読 〇〇〇〇〇〇〇さんが あなたのブログ(dddd)にコメントしました。 2017-06-25 09:32:07 UTC
しかし・・・見栄えが悪い為少し右に文字を寄せたいと考えています
現在のVIEW(HTML)、CSSは↓な感じです
おそらくCSSの↓の記載が左いっぱいによせるようなコードになっているので
これを少し右にずらす様に変えればいいと思うのですが
どの様なコードにかえればよろしいでしょうか?
CSS,全くの初心者でググってみましたが微妙に????です(><)
これが影響していると思うのですが・・・・
.left { text-align: left; }
何卒有識者の皆さま
お知恵を拝借させていただければ幸いです
(><)
VIEW(HTML)
<h2>お知らせ</h2> <ul> <% @notifications.each do |notification| %> <hr> <li> <span><%= notification.read ? '既読' : '未読' %></span> <p class="left"> <%= notification.comment.user.try(:name) %>さんが あなたのブログ(<%= link_to "#{notification.comment.blog.title}", blog_path(notification.comment.blog, notification_id: notification.id) %>)にコメントしました。 </p> <p class="left"><%= notification.created_at %> </p> </li> <% end %> </ul>
CSS
ul{ padding: 0; } .child li { padding-top: 13px; border-bottom: 1px dotted #ccc; list-style-type: none; } .right { text-align: right; } .left { text-align: left; }
回答1件
あなたの回答
tips
プレビュー