【问题标题】:use two different link style the same page在同一页面使用两种不同的链接样式
【发布时间】:2012-08-19 19:36:22
【问题描述】:

ı想在下面使用,但是出现error.problem..

a.tarz7:link,a:visited,a:active
{
display:block;
font-weight:bold;
color:#FFFFFF;
/* 
background-color:#6699FF;
*/
background-image:url(images/bgnisan2012/bg_rect_blue.gif);
width:130px;
text-align:center;
padding:1px;
text-decoration:none;
font-size:13px;
}
a.tarz7:visited
{
}

a.tarz7:hover
{
background-image:url(images/bgnisan2012/qbgblue.gif);
color:#FFFFFF;
} 

和..

a.buton_stil1{
    background:#3366CC;
    padding:5px 5px;
    text-decoration:none;
    color:#fff;
    font:bold 14px Arial, Helvetica, sans-serif;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
}


a.buton_stil1{
    background:#3366CC;
    padding:2px 5px;
    text-decoration:none;
    color:#fff;
    font:bold 14px Arial, Helvetica, sans-serif;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
}

a.buton_stil1{
    background:#3366CC;
    padding:2px 5px;
    text-decoration:none;
    color:#fff;
    font:bold 11px Arial, Helvetica, sans-serif;
    -moz-border-radius: 7px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    box-shadow: 1px 3px 4px #fff;
    -moz-box-shadow: 1px 1px 2px #000;
    -webkit-box-shadow: 3px 3px 4px #000;
}


a.buton_stil1:hover{
   /*  eski stil
   background-color:#3333FF;

    text-shadow: 1px 1px 1px rgba(0, 
    0,1, 0.25);
    */
box-shadow: 1px 3px 4px #000;
background-image:url(images/bgnisan2012/qbgblue.gif);

在我的顶部 div 上,我使用:buton_stil1

例子:

<td align="center">
<a href="dun.php" class="buton_stil1" > Dün&nbsp; </a>
</td> 

在我的内容 div 上,我使用 a.tarz7

示例:

<td>  
<a class="tarz7"  href="sorularim.php" > >>> </a>    
</td>

现在,我在 a.tarz7 上没有问题,但顶部按钮与 buton_stil1 有问题。 当我按下他们正在增长的按钮时。像 a.tarz7。


例子: 顿

当我点击此链接时,链接更改“tarz”

我想办法,把两个链接伪类的效果分开。但没有。 最终,我会删除其中一个吗?

谢谢。

【问题讨论】:

    标签: html css hyperlink pseudo-class


    【解决方案1】:

    很难阅读您的代码,但我想问题是这样的

    a.tarz7:link,a:visited,a:active
    

    你一定是这个意思

    a.tarz7:link,a.tarz7:visited,a.tarz7:active
    

    【讨论】:

    • 抱歉。你知道那是链接代码。他们都在运行。但在不同的页面上。如果我在同一页面中不仅写了“a.tarz7”,还写了“a.buton_stil1”。我使用它们。有错误。因为在代码 tarz7 ->display:block;和宽度:130px;错误是: Dün  当我点击此链接时,链接更改为“tarz”。
    • 当您编写a:visited,a:active 时,它会将该样式应用于页面上所有已访问和活动的链接。进行 Ashwin Singh 建议的更改。
    • 怎么样?我给他们起了一个不同的名字。
    • 不,你没有。你只用:link给了一个类名,你没有用:visited:active给一个类名。每个选择器都是不相关的,以a.tar7:link 开头的行并不意味着其余的选择器只针对.tar7
    • hımm ohhh 我的糟糕时光,这么多空的工作......谢谢。我意识到我的错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-12
    • 1970-01-01
    • 2019-07-21
    • 1970-01-01
    • 1970-01-01
    • 2020-07-15
    • 2012-10-03
    相关资源
    最近更新 更多