html - CSS 代码不适用于 chrome 和 Firefox,但适用于 IE

标签 html css internet-explorer google-chrome visual-studio-2012

我正在使用 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/

相关文章:

javascript - "Object doesn' t 支持此属性或方法“IE 7,8 & 9 中的 AJAX 错误

php - 为什么 Apache 像 PHP 一样执行 .php.html 文件?

node.js - 在循环中使用@key 在开发中工作正常但在生产中不工作

html - 如何防止 Bootstrap 4 表响应溢出它的父级

javascript - 需要元素在页面刷新时识别它在页面上的位置

css - Hotmail 边距顶部问题

internet-explorer - 恢复浏览器文本区域

javascript - 如何在 contenteditable div 中禁用元素选择和调整大小?

html - 为什么我的 CSS 不改变提交按钮的高度?

javascript - apostrope-images-widgets 自定义小部件调用 apos.attachments.url 两次