我正在使用 Visual Studio 2012,为我的网站创建了母版页。 所有其他页面都工作正常,但只有一个页面让我抓狂。
.aboutus
{ margin: auto;
font-family: 'Bookman Old Style';
font-style: normal;
font-weight: 100;
max-height:700px;
overflow:scroll;
overflow-x:hidden;}
.aboutus h1, .aboutus h2, .aboutus h3
{
color:blue;
font-style:italic;
font-weight: 500;}
如果我使用这个 css 类,它可以在 IE 上正常工作,但在 Chrome 或 mozilla 中什么也没有显示。 即使我从 .aboutus css 类中删除了内容,它仍然有同样的问题。
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="aboutus">
<h1>About us…</h1>
<p>Regional Automotive was started in 1994 at it’s current location in Ottawa
as a sister c..........
</div></asp:Content>
我的 asp:内容来自母版页
<div class="main-content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>
</div>
我在我的母版页中使用它,所以我不必为每个页面一次又一次地写同样的东西
.main-content
{display:block;
background-color:transparent;
min-height: 700px;
max-height:700px;
margin-left:2px;
margin-top:68px;}
可能是这个东西导致了问题。
最佳答案
我试过复制你的代码并在我的电脑上使用。在 Opera、Chrome、IE 中运行良好。
你有最新版本的浏览器吗?您可以尝试逐行编写 css 文件并尝试发现问题出在哪一行
关于html - CSS 代码不适用于 chrome 和 Firefox,但适用于 IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17453328/