How can I use CSS to change the color of dashes, underscores, and strikethroughs? I think it must have been a long time for everyone. Yes, it also causes a lot of trouble for me. When I want to use CSS to change the text to blue, strikethrough to red, or underline to yellow, but it is always impossible to achieve it, of course, you may think that for underline, we can change the border color to replace the above and underline effects. Although this may solve the problem for a while, it is not the best solution after all.
Use borders to enable upper and underline colors Code :
Code:
<Style type = "text/CSS">
<! --
. Page_number {
Color: royalblue;
Border: solid 1px # f00;
Border-left: none;
Border-Right: none;
}
--> </Style>
However, there is no way to delete a line.
However, some people may say that the text I want to modify is set globally and red, and the text is set to blue with <span>. This is also a good method.
Global colors are used to achieve the color effects of upper, underline, and strikethrough, and local colors are used to achieve the color effects of text. Code:
<HTML>
<Head>
<Style type = "text/CSS">
. Line {
Color: red;
Text-Decoration: Line-through;
}
. Text
{
Color: blue;
}
</Style>
</Head>
<Body>
<Div class = "line">
<SPAN class = "text"> but this <B> span </B> has it set to line-through. </span>
</Body>
</Html>
The effect is as follows:
However, when the problem is always solved, it seems that this problem has been solved since W3C released the relevant attributes of css3.0. Why did it not appear in people's field of view, most of today's browsers cannot support css3.0, but they are still stuck in the previous css2.0. I think this is a sentimental thing for our design lovers and it is hard to do a good job of code, but others cannot see our design results because of the browser. The biggest pain in the world is not so much.
Now let me briefly talk about the CSS attributes.
Text-line-through attribute settings:
Text-line-through-color: Specifies the color of the strikethrough.
Text-line-through-Mode : Sets the display mode of strikethrough.
Text-through-style : Set The linetype Of The strikethrough.
Text-overline attribute settings:
Text-overline-colo:
Text-overline-Mode :
Text-overline-style :
Text-underline attribute settings:
Text-underline-color :
Text-underline-mode:
Text-underline-style:
If it is not supported yet, write it first. For its usage, let's talk about it later. If you are interested, you can test it in a better browser. Haha!
Http://hi.baidu.com/zgalong/blog/item/d19779667b54a322ab184cd7.html