The following code sets the height and width of a <span> to 0 PX, and then creates a thick border. The borders in the other three directions are set to the same color as the background color, the background color of the border in the direction of the triangle is different. Note that: When designing the <span> of the display arrow, remember to design attributes such as the color of each border so that the color of the other three borders is the same as that of the background color, if no other single border is set, no effect is displayed. (Remember)
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style type = "text/css">
<! --
. D1 {
Width: 50px;
Height: 25px;
Display: block;
Text-align: center;
Display: block;
Line-height: 25px;
Text-align: left;
Font-size: 12px;
Border: 1px solid #000;
Position: relative;
Background-color: # FFF;
Text-decoration: none;
Color: # C00;
}
A: hover {
Border: 1px solid # C00;
}
A: hover span {
Width: 0px;
Height: 0px;
Display: block;
Right: 0px;
Top: 6px;
Position: absolute;
Overflow: hidden;
Background-color: # FFF;
Border-left-width: 6px;
Border-left-style: solid;
Border-left-color: # C00;
Border-top-width: 6px;
Border-bottom-width: 6px;
Border-right-width: 6px;
Border-top-style: solid;
Border-bottom-style: solid;
Border-right-style: solid;
Border-top-color: # FFF;
Border-bottom-color: # FFF;
Border-right-color: # FFF;
}
-->
</Style>
</Head>
<Body>
<A class = "d1" href = "#">
Hi!
<Span> </span>
</A>
</Body>
</Html>