美文网首页
页面中的小技巧

页面中的小技巧

作者: 0清婉0 | 来源:发表于2021-03-18 19:22 被阅读0次

今天肚子疼了一天,可能着凉了。今天只写了一点小技巧。有点偷懒了。

【单行和多行文本超出省略号】

// 单行文本出现省略号

width: 300px;

overflow: hidden;

text-overflow: ellipsis;

white-space: nowrap;

word-break: break-all;

// 多行文本出现省略号

display: -webkit-box; /*重点,不能用block等其他*/

-webkit-box-orient: vertical; /*从上到下垂直排列子元素*/

-webkit-line-clamp: 3; /*行数*/

line-clamp: 3;

word-break: break-all;

overflow: hidden;

max-width: 100%;

【设置input 的placeholder的字体样式】

// 设置input占位符的样式

input::-webkit-input-placeholder{color:gray;}

input::-moz-placeholder{color:gray;}

input:-ms-input-placeholder{color:gray;}

input:-moz-placeholder{color:gray;}

<input type="text" placeholder="请设置用户名">

// 设置input聚焦时的样式

input:focus{background-color: gray;}

// 取消input的边框

border: none;

outline: none;

【CSS优惠券】

<div class="coupon">

    <span>200</span>优惠券

</div>

.coupon {

width: 300px;

  height: 100px;

  line-height: 100px;

  margin: 50px auto;

  text-align: center;

  position: relative;

  background: radial-gradient(circle at right bottom, transparent 10px, #ffffff 0) top right /50% 51px no-repeat,

  radial-gradient(circle at left bottom, transparent 10px, #ffffff 0) top left / 50% 51px no-repeat,

  radial-gradient(circle at right top, transparent 10px, #ffffff 0) bottom right / 50% 51px no-repeat,

  radial-gradient(circle at left top, transparent 10px, #ffffff 0) bottom left / 50% 51px no-repeat;

  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, .2));

}

.coupon span {

  display: inline-block;

  vertical-align: middle;

  margin-right: 10px;

  color: red;

  font-size: 50px;

  font-weight: 400;

}

【细表格边框】

table{

  border-collapse: collapse;

}

相关文章

  • 页面中的小技巧

    今天肚子疼了一天,可能着凉了。今天只写了一点小技巧。有点偷懒了。 【单行和多行文本超出省略号】 // 单行文本出现...

  • 手动控制console.log开关

    手机端查看console.log网上有很多插件,在页面中引用就可以 小技巧:当页面url 有eruda=true参...

  • 简单介绍CSS布局和技巧

    惯例,我是标题:   在CSS中,我们经常需要布局来实现页面美化,那么怎么布局呢,来点小技巧。 1、左中右布局(左...

  • Windows小技巧 -- Chrome浏览器中页面保存技巧

    本文主要以百度首页为例,记录Chrome浏览器中,保存页面的多种方式(涉及一些Chrome的“小技巧”),涉及插件...

  • 禁止jsTree的拖拽功能

    一个小技巧,如何禁止jsTree的可以拖拽的问题. 其实很简单的啦,不想使用JSTree的拖拽功能,将页面中jst...

  • 页面搭建PS小技巧

    今天帮头头做一个品牌的品牌页面,由于给的图有些不需要,需要自己再处理一下,在处理的过程中,学到了一些小技巧: 1....

  • 前端页面编程小技巧

    前端编程,对于初学者来说,不仅仅是需要每天去接受新知识,而且要训练你的编码速度和提高你的代码质量。那么要快速高效的...

  • Axure实用小技巧

    Axure实用小技巧 1、需要重复使用的元件,建议创建或母版使用;如果修改了母版,所有页面中的母版元件将会被同步修...

  • iOS小技巧总结

    iOS小技巧总结### 参考iOS_小松哥的iOS小技巧总结 总结日常代码生活中的小技巧,随时可用 阿拉伯数字转中...

  • 前端面试题总结

    1、微信小程序中,一般会问我们如果从A页面,进入B页面,在B页面中修改A页面中的数据,再返回A页面,此时A页面中的...

网友评论

      本文标题:页面中的小技巧

      本文链接:https://www.haomeiwen.com/subject/hxppcltx.html