From 2a4c8d3056f4d6e354e8aac3ab529b59805d256a Mon Sep 17 00:00:00 2001 From: Map1en_ Date: Wed, 26 Jan 2022 14:33:12 +0800 Subject: fix(doublecolon-after): sample code of tooltips (#3746) --- files/zh-cn/web/css/_doublecolon_after/index.html | 52 +++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'files/zh-cn') diff --git a/files/zh-cn/web/css/_doublecolon_after/index.html b/files/zh-cn/web/css/_doublecolon_after/index.html index b4dc41dbbf..34259be206 100644 --- a/files/zh-cn/web/css/_doublecolon_after/index.html +++ b/files/zh-cn/web/css/_doublecolon_after/index.html @@ -48,13 +48,13 @@ element::after { style properties } /* CSS3 语法 */ } .boring-text::after { - content: "<- 无聊!"; - color: red; + content: "<- 无聊!"; + color: red; }

输出

-

{{ EmbedLiveSample('Simple_usage', 500, 150) }}

+

{{ EmbedLiveSample('Simple_usage', 500, 170) }}

装饰用法

@@ -63,14 +63,14 @@ element::after { style properties } /* CSS3 语法 */
<span class="ribbon">Notice where the orange box is.</span>
.ribbon {
-  background-color: #5BC8F7;
+ background-color: #5BC8F7;
 }
 
 .ribbon::after {
-  content: "Look at this orange box.";
-  background-color: #FFBA10;
-  border-color: black;
-  border-style: dotted;
+ content: "Look at this orange box.";
+ background-color: #FFBA10;
+ border-color: black;
+ border-style: dotted;
 }

输出

@@ -84,35 +84,35 @@ element::after { style properties } /* CSS3 语法 */
<p>这是上面代码的实现<br />
   我们有一些 <span data-descr="collection of words and punctuation">文字</span> 有一些
   <span data-descr="small popups which also hide again">提示</span>。<br />
-  把鼠标放上去<span data-descr="not to be taken literally">看看</span>.
+  把鼠标放上去<span data-descr="not to be taken literally">看看</span>。
 </p>
 
span[data-descr] {
-  position: relative;
-  text-decoration: underline;
-  color: #00F;
-  cursor: help;
+ position: relative;
+ text-decoration: underline;
+ color: #00F;
+ cursor: help;
 }
 
 span[data-descr]:hover::after {
-  content: attr(data-descr);
-  position: absolute;
-  left: 0;
-  top: 24px;
-  min-width: 200px;
-  border: 1px #aaaaaa solid;
-  border-radius: 10px;
-  background-color: #ffffcc;
-  padding: 12px;
-  color: #000000;
-  font-size: 14px;
-  z-index: 1;
+ content: attr(data-descr);
+ position: absolute;
+ left: 0;
+ top: 24px;
+ min-width: 200px;
+ border: 1px #aaaaaa solid;
+ border-radius: 10px;
+ background-color: #ffffcc;
+ padding: 12px;
+ color: #000000;
+ font-size: 14px;
+ z-index: 1;
 }

输出

-

{{ EmbedLiveSample('Tooltips', 450, 120) }}

+

{{ EmbedLiveSample('Tooltips', 450, 160) }}

规范

-- cgit v1.2.3-54-g00ecf