2010-11-26 30 views
1

alt text如何在兩行上劃線超鏈接。 CSS的HTML極客?

我將以下CSS應用於上述文本。如何使以上超鏈接的下劃線如下所示。例如像這樣的alt text

.result-listingext h3 
{ 

    display:block; 
    margin:0; 
    padding-right:10px; 
    padding-left:10px; 
    color:#b2002f; 
    font-family: Arial, Verdana; 
    text-decoration: none; 
    background: white; 
    font-size:0.94em; 
    font-weight:normal; 
    line-height:1.3; 
} 

    .result-listingext h3 a:visited 
{ 
    font-family: Arial, Verdana; 
    text-decoration: none; 
    background: white; 
    font-size:0.94em; 
    color:#000; 
    font-weight:normal; 
    line-height:1.3; 
} 


.result-listingext h3 a:link, 
.result-listingext h3 a:hover, 
.result-listingext h3 a:focus, 
.result-listingext h3 a:active { 
    color:#b2002f; 
     font-family: Arial, Verdana; 
    text-decoration: none; background: white; 
    font-size:0.94em; 
    font-weight:normal; 
    line-height:1.3; 
} 
+1

你有什麼問題? – benhowdle89 2010-11-26 10:02:44

+0

請參閱我的回覆 – 2010-11-26 10:03:21

回答

6

要使文本下劃線與文本顏色不同,您需要border-bottom

border-bottom: 1px grey solid; 

的jsfiddle here

您可以使用padding-bottom/padding-topline-height控制文本和邊界,每條線之間的距離。

2

我認爲你正在尋找:

CSS:

.myClass a 
{ 
    text-decoration: underline; 
} 

反而沒有像你。