简体   繁体   English

CSS代码不适用于Chrome和Firefox,但适用于IE

[英]CSS code is not working with chrome and Firefox but IE

I am working with Visual studio 2012, Created a masterpage for my website. 我正在使用Visual Studio 2012,为我的网站创建了一个母版页。 all other pages are working fine but only one page driving me crazy. 其他所有页面都工作正常,但只有一页使我发疯。

.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;}

IF I use this css class it work fine with IE but nothings shows up in Chrome or mozilla. 如果我使用此CSS类,则可以在IE上正常工作,但在Chrome或mozilla中什么也没显示。 even if I delete contants from .aboutus css class it still have the same problem. 即使我从.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>

My asp:Content is from masterpage 我的asp:内容来自母版页

<div class="main-content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>
 </div> 

I use this in my masterpage so I dont have to write the same thing again and again for every page 我在母版页中使用它,所以我不必为每个页面一次又一次地写相同的东西

.main-content
{display:block;
background-color:transparent;
min-height: 700px;
max-height:700px;
margin-left:2px;
margin-top:68px;}   

may be this thing causing a problem. 可能是这件事引起了问题。

I tried copy your code and use at my PC. 我尝试复制您的代码并在PC上使用。 Workst fine in Opera, Chrome, IE. 在Opera,Chrome,IE中无法正常运行。

Do you have latest version of browsers? 您是否有最新版本的浏览器? You can try write css file line by line and try to discover which line do the problem 您可以尝试逐行写入css文件,并尝试找出问题所在的行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM