关于本站
“最难不过坚持”
本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作
有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339
2712
39
分类目录
最新评论
- https://jueru.net/
-
评 留言
- :weixiao:
-
评 留言
- :shuijiao: :weiqu: :zhenbang: :leng:
-
评 留言
- :yiwen: :yiwen: :yiwen: :yiwen:
-
评 EasySass: could not generate CSS file. See Output panel for details.
- 这个业务逻辑多少都有点奇怪了,阅读浏览次数增值在新闻详情页的控制器方法里setInc,这怎么还写进模型事件里了。如果非要用onAfterRead也可以,把新闻文章的内容单独分出来一个news_content表,然后把它和news做关联,然后给news_content表的onAfterRead事件做增值处理,这样点进新闻页内查询到文章内容时才会触发它。
-
评 TP6模型事件-查询后onAfterRead不好用
文章标签更多
打开边栏(ESC)
关闭边栏(ESC)
bootstrap5对于较长的内容,可以添加.text-truncate类别,以省略号截断文字。需为display: inline-block或是display: block。
<!-- Block level -->
<div class="row">
<div class="col-2 text-truncate">
Praeterea iter est quasdam res quas ex communi.
</div>
</div>
<!-- Inline level -->
<span class="d-inline-block text-truncate" style="max-width: 150px;">
Praeterea iter est quasdam res quas ex communi.
</span>
如图:
.text-truncate样式
.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
如果想实现两行或三行文字截断呢
自定义.text-truncate-2,可以截取两行文字显示省略号,不过与d-inline-block等有冲突
.text-truncate-2{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
html
<span class="text-truncate-2" style="max-width: 150px; min-height: 40px;"> Praeterea iter est quasdam res quas ex communi.Praeterea iter est quasdam res quas ex communi.Praeterea iter est quasdam res quas ex communi. </span>如图:
注意:当ellipsis和display:block同时应用时,ellipsis会失效,其实是overflow:hidden和display:bock冲突,分两个div应用就可以解决这个问题
<div class="mb-0 d-none d-lg-block">
<span class="text-truncate-2" style="max-width: 150px; min-height: 40px;">
Praeterea iter est quasdam res quas ex communi.Praeterea iter est quasdam res quas ex communi.Praeterea iter est quasdam res quas ex communi.
</span>
</div>
赏
相关推荐
bootstrap5 横线(水平线)hr的使用
bootstrap5 横线(水平线)hr的使用
css样式:
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
heigh...
bootstrap5 实现col右对齐
实现效果:搜索框右对齐
方式一:由于bootstrap5 列构建在网格的弹性盒子体系结构上,所以我们直接使用flex布局样式.justify-content-end,控制右对齐
<div class="container">
<div class="row justify-content-end...
评论加载中...
前一篇: bootstrap5 按钮大小