html - How do I apply bootstrap's clearfix to my code? -
i'm using wysiwyg editor in project, , part of editor includes option set images' position left, right, inline. when choose left, gives float-left feature. i'm wondering how can make div containing content automatically expands allow floating images.
below code posts partial use in project
<div class="thumbnail"> <div class="text"> <%= link_to post.title, post_path(post), class: "h1" %> <p class="pull-right"><span class="glyphicon glyphicon-time"></span> posted on <%= post.created_at.to_formatted_s :long %></p> <hr> <p><%= post.content.html_safe %></p><hr> <p> <% post.tags.any? %> <div class="btn-group btn-group-xs" role="group" aria-label="..."> <% post.tags.each |tag| %> <%= link_to tag.name, tag_path(tag), class: "btn btn-info" %> <% end %> </div> </p> </div> </div>
you can use clearfix outside of bootstrap. long define in css this:
.clearfix::after { content: " "; display: table; clear: both; }
and apply "clearfix" class element requires, this:
<div class="clearfix"></div>
it should work.
Comments
Post a Comment