Home > Web Front-end > HTML Tutorial > CSS如何设置对象中第一行文本的样式_html/css_WEB-ITnose

CSS如何设置对象中第一行文本的样式_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:08:31
Original
1589 people have browsed it

CSS如何设置对象中第一行文本的样式:

可能有时候需要特别设置对象中第一行文本的样式,下面简单介绍一下。

代码实例:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.51texiao.cn/" /><title>蚂蚁部落</title><style type="text/css">div {    width: 100px;    height: 300px;    border: 1px solid red;}div:first-line {    color: red;}</style></head><body><div>大家好,欢迎来到蚂蚁部落,希望大家能够给予有意的建议。</div></body></html>
Copy after login

以上代码实现了对第一行文本的样式设置。使用的是E:first-line属性,此属性各个浏览器都兼容。

原文地址是:http://www.51texiao.cn/div_cssjiaocheng/2015/0508/940.html

最为原始地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=4685

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template