Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将属性转换为标记中除文本以外的所有内容_Html_Css_Transition - Fatal编程技术网

Html 将属性转换为标记中除文本以外的所有内容

Html 将属性转换为标记中除文本以外的所有内容,html,css,transition,Html,Css,Transition,我很好奇是否有可能让我的悬停过渡效果对这个标签中的所有内容都有效,而不是标签中的文本。如果此效果与Invisioune相同,则选项卡的按钮将淡出,但按钮中的名称将保留 以下是我迄今为止的代码: ul.nav a{ z-index: 99999; position: relative; right: 20px; bottom: -5px; font-family: "Trebuchet MS", Helvetica, sans-serif; dis

我很好奇是否有可能让我的悬停过渡效果对这个标签中的所有内容都有效,而不是标签中的文本。如果此效果与Invisioune相同,则选项卡的按钮将淡出,但按钮中的名称将保留

以下是我迄今为止的代码:

ul.nav a{
    z-index: 99999;
    position: relative;
    right: 20px;
    bottom: -5px;
    font-family:  "Trebuchet MS", Helvetica, sans-serif;
    display: block;
    border: 2px solid #000;
    border-radius: 5px;
    padding: 9px 15px 20px 15px;
    margin-right: 5px;
    background-color: #EAEAEA;
    text-decoration: none; 
    text-align: center;
    color: #333;
    transition: opacity .5s ease-in-out;
}
和悬停属性:

ul a:hover{
    background-color: #8F8F8F;
    opacity: .10;
    transition: background-color opacity 1s ease-out;
}

       <ul class ="nav">
       <li><a href="http://www.google.com">Home</a></li>
       <li><a href="http://www.gmail.com">Portfolio</a></li>
       <li><a href="http://www.facebook.com">About</a></li>
       <li><a href= "http://www.Flickr.com">Blog</a></li>
       <li class="floatr"><a href="http://www.flickr.com">Contact</a></li>
    </ul>
ula:悬停{
背景色:#8F8F;
不透明度:.10;
过渡:背景色不透明度降低1s;
}

应该这样做:使用
rgba
颜色格式,而不是更改元素的不透明度。此颜色格式允许您在仅设置颜色的同时设置不透明度,因此可以设置背景不透明度而不是元素不透明度。因此,在主要样式(悬停前的样式)中,使用
rgba(234234234,1)
而不是
#EAEAEA
作为
背景色
,然后在悬停样式中,使用
rgba(143143143,0.1)
而不是
#8F8F

谢谢您的帮助!我喜欢帮忙!另外,我看到你是stackoverflow的新手,当一个答案完全回答了你的问题时,请点击计票下方的绿色小“复选框”。这将把答案标记为“已接受”,给了答案er 15的声誉,给了你2