我一直在调整一些 CSS,我正在更改锚标签的样式。这很好用。让我感到困惑的是,为什么在一个完全不同的 div 中具有不同类/ID 的东西会受到这种样式的影响?(例如,我的小风格将样式添加到页面底部的一个小 div 块,但出于某种奇怪的原因,它开始影响顶部的管理导航栏)顺便说一句,我正在开发 DotNetNuke 皮肤。
浏览 Chrome 中的 Inspect 选项,它就像是继承了这些样式,即使我创建的这个样式类应该没有链接!
我检查了我的 DIV,它们正确配对。
所以我只是想知道我还能检查什么来阻止这种情况的发生。我可能会遗漏一些非常简单/明显的东西。
谢谢!
编辑:嗯,是的,显然我应该包含代码;)愚蠢的我!
好的,这是影响皮肤的 CSS 代码:
#ehcbreadcrumbs {
background-color: #BCBCBC;
color: White;
font-size: 1.1em;
padding-top: 4px;
padding-right: 0px;
padding-bottom: 4px;
padding-left: 10px;
margin-top: 5px;
}
#ehcbreadcrumbs a, a:link {
text-decoration: none;
color: White;
font-size: 1.1em;
}
#bottomnavbar {
padding-top: 4px;
padding-bottom: 4px;
display: table;
}
#bottomnavbar ul {
margin: 0 auto;
}
#bottomnavbar ul li {
display: inline;
}
#bottomnavbar a, a:link {
text-decoration: none;
}
#bottomnav a, a:link {
font-size: 14px;
}
这是皮肤文件:
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LINKS" Src="~/Admin/Skins/Links.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
<%@ Register TagPrefix="dnn" TagName="MENU" Src="~/DesktopModules/Infinity.Menu/ViewMenu.ascx" %>
<%@ Register TagPrefix="snapsis" Namespace="Snapsis.DNN.Skins" Assembly="Snapsis.DNN.NavMenu" %>
<%@ Register TagPrefix="ddr" TagName="DDRMENU" src="~/DesktopModules/DDRMenu/Menu.ascx" %>
<%@ Register TagPrefix="ddr" Namespace="DotNetNuke.Web.DDRMenu.TemplateEngine" Assembly="DotNetNuke.Web.DDRMenu" %>
<%@ Register TagPrefix="google" TagName="FOOTER" Src="Footer.ascx" %>
<script src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/js/common.js") %>" type="text/javascript"></script>
<div class="cpanel_right">
<div class="cpanel_left">
<div runat="server" id="ControlPanel"></div>
</div>
</div>
<div class="clear"></div>
<div class="wrapper">
<div class="layout">
<!--Head Start-->
<div class="BCKhead">
<div class="logo"><dnn:LOGO runat="server" id="LOGO1" />
<h1 class="hideFromView">XXXXXX</h1>
<h2 class="hideFromView">XXXXXXX</h2>
</div>
<div class="top">
<div class="topmenu">
<ul>
<li class="last"><a href="/TheXXXXpilot/Deliveringtheproject/Theprojectteam/tabid/66/language/en-AU/Default.aspx" title="Contact Us">Contact Us</a></li>
<li><a href="/TheXXXXpilotprogram/FrequentlyAskedQuestions/tabid/137/language/en-US/Default.aspx" title="View the FAQ">FAQ</a></li>
<li><a href="/UsetheXXXX/tabid/155/language/en-US/Default.aspx" title="Use the XXXX">Use the XXXX</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="accessibility">
<a href="javascript:changeFontSize(-1)" title="Decrease font size"><img src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/images/resizesmall.gif") %>" alt="Decrease font size"/></a> <a href="javascript:changeFontSize(1)" title="Increase font size"><img src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/images/resizelarge.gif") %>" alt="Increase font size"/></a>
</div>
<div class="searchbox">
<div style="display:none"></div>
<div id="dnn_dnnSEARCH_DropDownSearch">
<dnn:SEARCH ShowWeb="false" ShowSite="false" UseDropDownList="false" Submit="Search" runat="server" ID="dnnSearch2" CssClass="searchbox"/>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<!--Head End-->
<!--Container Start-->
<div class="container_inner" id="container_inner">
<div class="leftcontent">
<div class="mainmenu innerHeight">
<Snapsis:NavMenu id="LeftNav" CacheTabs="false" Level="0-2" Type="Hover"
OnlyExpandActive="false" ShowType="Always"
EnableViewState="true"
runat="server" ExcludeTabs="Admin,Host" />
<div class="clear"></div>
</div>
<div style="height:5px; overflow:hidden; background:#fff;" id="WhiteDiv"></div>
<div id="LeftPane" runat="server" class="LeftPane"></div>
</div>
<div class="rightcontent">
<div class="banner"><a href="/UsetheXXXX/tabid/155/language/en-US/Default.aspx" ><img src="<%= Page.ResolveUrl("Portals/_default/Skins/BCKGraphic/images/inner_banner.jpg") %>" /></a></div>
<div class="RightDiv">
<div id="ehcbreadcrumbs">
<dnn:TEXT runat="server" id="dnnTEXT" Text="You are here >" ResourceKey="Breadcrumb" /> <dnn:BREADCRUMB ID="dnnBREADCRUMB" RootLevel="0" Separator=" > " runat="server" />
</div>
<div id="RightPane" runat="server" class="RightPane"></div>
</div>
</div>
<div class="clear"></div>
<div id="ContentPane" runat="server" class="ContentPane"></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="clear"></div>
<!--Container End-->
<div class="bottomcontent"></div>
<div id="bottomnavbar">
<ddr:DDRMENU MenuStyle="sitemap" NodeSelector="RootOnly" runat="server" ></ddr:DDRMENU>
</div>
</div>
</div>
<!--Foot Start-->
<div class="footer">
<div class="footer_con">
<div>footer text</div>
<div class="clear"></div>
</div>
</div>
<% If DotNetNuke.Security.PortalSecurity.IsInRoles("Administrators") Then%>
<div class="copyright">
Logged in as <dnn:USER runat="server" id="dnnUSER" CssClass="user" /> |
<dnn:LOGIN runat="server" id="dnnLOGIN2" CssClass="copyright" Text="Login" />
</div>
<%End If%>
<!--Foot End-->
<dnn:STYLES runat="server" id="StylesIE6" Name="IE6Minus" StyleSheet="css/ie6skin.css" Condition="LT IE 7" UseSkinPath="true" />
<script type="text/javascript" >
if(dnn_LeftPane.className.indexOf("DNNEmptyPane") != -1)
{
if(dnn_ContentPane.className.indexOf("DNNEmptyPane") == -1)
{
document.getElementById("WhiteDiv").style.display = "none";
document.getElementById("container_inner").className = "container_inner_setting";
}
}
else
{
document.getElementById("WhiteDiv").style.display = "";
document.getElementById("container_inner").className = "container_inner";
}
</script>
<google:FOOTER id="footer1" runat="Server"></google:FOOTER>
所以底部导航栏/底部内容中的样式似乎会影响 DNN 管理栏(ControlPanel)的某些方面。如果我在底部导航栏中更改字体大小,它也会影响登录的用户部分,“版权”块锚位中的字体大小也会改变大小。这让我很困惑为什么,因为 DIV 块(对我来说)看起来正确配对。
是的,我知道它不是很漂亮;)(皮肤最初是由其他人创建的,我已经接手对其进行了更改)