文本换行以及两端对齐

This commit is contained in:
caishi 2017-08-28 09:19:59 +08:00
parent 8cb233fbdb
commit 6fe4f200f2
3 changed files with 6 additions and 5 deletions

View File

@ -30,7 +30,7 @@
<p class="font-14 course-list-index-title two_lines_show task-text-center mb5 mt5" style="height: 44px">
<a href="javascript:void(0);" style="height: 44px;display: block;line-height: 22px;"><%= subject.name %></a>
</p>
<p class="font-14 three_lines_show task-text-center mb20 color-dark-grey" style="text-align: left;">
<p class="font-14 three_lines_show task-text-center mb20 color-dark-grey justify break_word" style="text-align: left;">
<%= subject.description.blank? ? "轻松学习#{subject.name}~" : subject.description %>
</p>
<p class="color-grey bor-bottom-greyE mb5 clearfix" style="text-align: center;">
@ -43,7 +43,7 @@
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(subject.user), :width =>"40", :height => "40", :class => "bor-radius-all mr10 fl mt8", :alt=>"头像") %></a>
<div class="fl" style="flex: 1;text-align: left">
<p class="color-dark-grey"><%= subject.user.try(:show_name) %></p>
<p class="font-12 unit-name color-dark-grey"><%= subject.user.school_name + subject.user.identity %></p>
<p class="font-12 unit-name color-dark-grey"><%= subject.user.school_name %></p>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@
<% end %>
</p>
<div class="mt10 color-dark-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %> justify">
<pre style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.description.blank? ? "暂未填写" : (@subject.description) %></pre>
<pre class="pre_word" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.description.blank? ? "暂未填写" : (@subject.description) %></pre>
</div>
</div>
<% end %>
@ -122,7 +122,7 @@
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑"></i></a>
<% end %>
</p>
<p class="mt10 mb10 color-dark-grey justify"><pre style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></pre></p>
<p class="mt10 mb10 color-dark-grey justify"><pre class="pre_word" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></pre></p>
</div>
<div class="edu-class-right-box ml15 user_bg_shadow bor-grey-e pl15 pt15 pr15">
<p class="font-16">教学团队
@ -135,7 +135,7 @@
<p style="line-height: 15px"><%= @subject.user.try(:show_name) %></p>
<p style="line-height: 27px" class="color-dark-grey font-12"><%= @subject.user.school_name + @subject.user.identity %></p>
</div>
<p class="mb10 color-dark-grey produce justify"><pre style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.user.user_extensions.brief_introduction.blank? ? "暂未填写" : @subject.user.user_extensions.brief_introduction %></pre></p>
<p class="mb10 color-dark-grey produce justify"><pre class="pre_word" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.user.user_extensions.brief_introduction.blank? ? "暂未填写" : @subject.user.user_extensions.brief_introduction %></pre></p>
<textarea id="user_produce_text" class="mb10 with100 panel-box-sizing produce_text undis" style="min-height: 100px;"></textarea>
<input id="current_user_id" value="<%= User.current.id %>" type="hidden">
</div>

View File

@ -177,6 +177,7 @@ a.course-bth-blue{cursor: pointer;background-color:#199ed8 ;color: #ffffff !impo
/*pre标签换行*/
.break_word{word-break: break-all;word-wrap: break-word;}
.break_word_firefox{white-space: pre-wrap !important;word-break: break-all;}
.pre_word{white-space: pre-wrap;word-wrap: break-word;}
.pr {position:relative;}
.df {display:flex;}
.w100{width: 100px;}