当前位置: 首页 > news >正文

css3 中text-align:justify

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

css3中text-align:center:justify;

这个属性是单词两端对齐的意思。 

值justify可以使文本的两端对齐。在两端对齐的文本中,文本行的左右两端都放在父元素的内边界上。然后,调整单词和字符间的间隔,使各行的长度恰好相等。

举例:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>css中display:justify</title>
    <style>
    .box1{ width:500px; line-height:20px; margin:10px auto; background-color:#cdd; text-align:justify;}
    .box2{ width:500px; line-height:20px; margin:10px auto; background-color:#cdd; text-align:left;}
    </style>
  </head>
  <body>
      <div>There is clearly a need for CSS to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The code remains the same, the only thing that has changed is the external .css file. Yes, really</div>
      <div>There is clearly a need for CSS to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The code remains the same, the only thing that has changed is the external .css file. Yes, really</div>
  </body>
</html>

效果图:

170303_v2xD_1250113.png

css3伪元素 ---------- ::selection

    定义和用法

    ::selection 选择器匹配被用户选取的选取是部分。

::selection{
    background:#f00;
    color:#00f;
}
::-moz-selection{
    background:#f00;
    color:#00f;
}

该伪元素只能设置两个属性background和color,设置其他属性不起作用。

兼容的浏览器:

::selection在IE家族中,只有IE9+版本支持,在Firefox中需要加上其前缀“-moz”


转载于:https://my.oschina.net/zyxchuxin/blog/488749

相关文章:

  • HDU-1503 Advanced Fruits(LCS)
  • LightOJ-1253 Misere Nim(Nim求解不正常的博弈)
  • python发送电子邮件模块smtplib
  • uva-1349 Optimal Bus Route Design(最小费用最大流)
  • 一个简单的通用验证类的实现
  • ZOJ-3987 Numbers 2017CCPC秦皇岛站G题 (二进制乱搞、贪心)
  • iOS开发-类簇(Class Cluster)
  • HDU-1350 Taxi Cab Scheme(最小路径覆盖)
  • codeforces-884D Boxes And Balls(思维、三叉哈夫曼树)
  • 设置c++程序的堆栈空间解决栈溢出问题
  • POJ-1932 XYZZY(判正权环路+Warlshell传递闭包)
  • Codeforces 827C DNA Evolution(多维树状数组)
  • larbin是一种开源的网络爬虫/网络蜘
  • Codeforces 855E Salazar Slytherin's Locket(数位dp)
  • JAVA爬虫 WebCollector
  • [PHP内核探索]PHP中的哈希表
  • 2018天猫双11|这就是阿里云!不止有新技术,更有温暖的社会力量
  • Android优雅地处理按钮重复点击
  • EventListener原理
  • gcc介绍及安装
  • Hibernate最全面试题
  • js
  • oldjun 检测网站的经验
  • ReactNativeweexDeviceOne对比
  • tensorflow学习笔记3——MNIST应用篇
  • ViewService——一种保证客户端与服务端同步的方法
  • vue-loader 源码解析系列之 selector
  • 从@property说起(二)当我们写下@property (nonatomic, weak) id obj时,我们究竟写了什么...
  • 排序算法之--选择排序
  • 深度学习入门:10门免费线上课程推荐
  • 使用common-codec进行md5加密
  • 微信小程序:实现悬浮返回和分享按钮
  • No resource identifier found for attribute,RxJava之zip操作符
  • 智能情侣枕Pillow Talk,倾听彼此的心跳
  • ​创新驱动,边缘计算领袖:亚马逊云科技海外服务器服务再进化
  • #ubuntu# #git# repository git config --global --add safe.directory
  • #Ubuntu(修改root信息)
  • (2)(2.10) LTM telemetry
  • (30)数组元素和与数字和的绝对差
  • (4)通过调用hadoop的java api实现本地文件上传到hadoop文件系统上
  • (解决办法)ASP.NET导出Excel,打开时提示“您尝试打开文件'XXX.xls'的格式与文件扩展名指定文件不一致
  • (六)c52学习之旅-独立按键
  • (转)Android中使用ormlite实现持久化(一)--HelloOrmLite
  • .bat批处理(九):替换带有等号=的字符串的子串
  • .bat批处理(十):从路径字符串中截取盘符、文件名、后缀名等信息
  • .equal()和==的区别 怎样判断字符串为空问题: Illegal invoke-super to void nio.file.AccessDeniedException
  • .NET 8 中引入新的 IHostedLifecycleService 接口 实现定时任务
  • .Net core 6.0 升8.0
  • .NET 程序如何获取图片的宽高(框架自带多种方法的不同性能)
  • .net6解除文件上传限制。Multipart body length limit 16384 exceeded
  • /dev/sda2 is mounted; will not make a filesystem here!
  • ??在JSP中,java和JavaScript如何交互?
  • [ vulhub漏洞复现篇 ] Apache APISIX 默认密钥漏洞 CVE-2020-13945
  • [20170728]oracle保留字.txt
  • [AIGC] SQL中的数据添加和操作:数据类型介绍