我一直在 Asp.net 的一个论坛上工作,我遇到的问题是,当我将鼠标光标悬停在我的 div 上时,它会处理从不透明度到带下划线文本的所有细节,但是当我将光标从div 它不会回到以前的状态“正常状态”。
我在一个普通的 html 页面上构建我的代码并且一切正常,当我将它集成到我的 Asp.net 模板中时它开始出现这个错误。我知道可能有很多事情,我检查了模板的所有 CSS,一切看起来都很好,它们应该没有冲突,但我一定是漏掉了什么。我无法放置所有代码,因为它有很多 CSS 和 HTML 行,所以这里是其中的一部分。希望大家指点一下看看。
CSS
ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#content {
background-color: white;
margin-top: 15px;
padding: 10px;
height: 1200px;
}
#content h2 {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 23px;
color: black;
margin: 0;
margin-top: 10px;
}
#content p {
font-family: "Tahoma", Arial, Helvetica, sans-serif;
font-size: 13px;
padding-left: 15px;
margin: 0;
width: 90%;
}
.forum-group {
width: 948px;
height: 259px;
margin-left: auto;
margin-right: auto;
}
.header-2 {
width: 948px;
height: 35px;
}
.child-forum {
width: 310px;
height: 106px;
float: left;
background-image: url('images/forum-child-background2.jpg');
opacity: 0.9;
filter: alpha(opacity=90);
margin-left: 6px;
margin-bottom: 4px;
border-radius: 10px;
}
.child-forum:hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.child-forums {
width: 948px;
height: 219px;
}
.forum-link {
width: 309px;
height: 106px;
display: inline-block;
}
.forum-icon {
width: 60px;
height: 60px;
display: inline-block;
background-image: url('images/hot_forum.png');
}
.forum-details {
width: 220px;
height: 43px;
display: inline-block;
}
.forum-title {
width: 217px;
height: 18px;
display: inline-block;
color: white;
font-size: 16px;
margin-left: 10px;
}
.forum-desc {
width: 217px;
height: 15px;
display: inline-block;
color: grey;
font-size: 12px;
margin-left: 10px;
}
HTML 内容页面
<%@ Page Title="" Language="C#" MasterPageFile="~/masterPage.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="aspnetw24prise2.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="content">
<br /><br />
<div class="forum-group">
<h2 class="header-2">Community</h2>
<ul class="child-forums">
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">General Discussion</span>
<span class="forum-desc">Discuss about cars</span>
</span>
</a>
</li>
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">Latest News</span>
<span class="forum-desc">Talk about new stuff</span>
</span>
</a>
</li>
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">Rules</span>
<span class="forum-desc">Important for new members</span>
</span>
</a>
</li>
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">Events</span>
<span class="forum-desc">Stay in touch</span>
</span>
</a>
</li>
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">Media</span>
<span class="forum-desc">Videos & pictures</span>
</span>
</a>
</li>
<li class="child-forum">
<a class="forum-link" href="#">
<span class="forum-icon"></span>
<span class="forum-details">
<span class="forum-title">FAQ</span>
<span class="forum-desc">Get answers</span>
</span>
</a>
</li>
</ul>
</div>
</asp:Content>
最佳答案
只是想检查一下...您将“.child-forum”设置为“不透明度:0.9”。这几乎与悬停的不透明度相同。
将“.child-forum”设置为 0 并仔细检查它是否真的不起作用。可能很难说。 (?)
关于html - Asp.net Css 悬停错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29355037/