我的CSS没有在Internet Explorer 11和Firefox中加载!仅适用于Chrome

mal*_*ser 2 html css firefox internet-explorer google-chrome

我正在创建一个简单的网页.我的CSS仅适用于Chrome.它在Firefox和IE11中都不起作用.

这是我的HTML

<html>
<head>
    <title>text</title>
    <link href="css/stylesheet.css" type="css/stylesheet" rel="stylesheet" media="all"/>
</head> 
    <body>
        <h1><b><u>Adding a new Visitor</u></b></h1><br/></br>
        <div class="wrapper">
            <figure>
                <img src="images/advis1.png"/>
                <figcaption style="padding-top: 12px;">text</figcaption>
            </figure>
            <hr/>
            <figure>
                <img src="images/advis2.png"/>
                <figcaption style="padding-top: 12px;">text</figcaption>
            </figure>
            <hr/>
            <figure>
                <img src="images/advis3.png"/>
                <figcaption style="padding-top: 12px;">text.</figcaption>
            </figure>
            <hr/>
            <h3><u>Result</u></h3> 
                <img src="images/advis4.png"/>
                <br/>
                <img src="images/advis5.png"/>
            </div>
            <footer>
                Author: Malcolm Tanti | Contact information: <a href="mailto:xxx">xxxxm</a>
            </footer>
    </body>
Run Code Online (Sandbox Code Playgroud)

这是我的CSS

h1 {

    text-align: center;
    border-bottom: double;
    border-left: double;
    border-right: double;
    width: 75%;
    margin: 0 auto;
    padding-top: 25px;
    padding-bottom: 25px;
    background-color: #C4CEDD;
    box-shadow: inset 0 20px 20px -20px #000000;
}

body {
    padding:0px;
    margin:0px;
    border:none;
    background-color: #7ea2d6;
    font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif;
}

.wrapper {
    box-shadow: inset 0 20px 20px -20px #000000;
    border: double;
    padding-top: 50px;
    padding-bottom:50px;
    width: 75%;
    margin: 0 auto;
    text-align: center;
    font-size: 20px;
    background-color: #C4CEDD;
}

img { 
   border:3px double;
   display: block;
   margin: 0 auto;
}

footer {
    padding-top: 10px;
    text-align: center;
    font-size: 14px;
}
Run Code Online (Sandbox Code Playgroud)

我对CSS很新,但HTML和HTML.它在Chrome中工作得非常好,这让我想知道问题是什么.我的问题是没有任何css加载,并且所有图像和文本都没有对齐.我甚至没有任何颜色

小智 5

我测试了你的代码,发现如果从中删除type ="css/stylesheet":

<link href="css/stylesheet.css" type="css/stylesheet" rel="stylesheet" media="all"/>
Run Code Online (Sandbox Code Playgroud)

它看起来像:

<link href="css/stylesheet.css" rel="stylesheet" media="all">
Run Code Online (Sandbox Code Playgroud)

您也不需要结束/结束.

它解决了这个问题.(测试标准模式不是怪癖)

你不应该这样做:

<h1><b><u>Adding a new Visitor</u></b></h1><br/></br>
Run Code Online (Sandbox Code Playgroud)

下划线,字体粗细和间距(边距/填充)应在CSS中完成:

<h1>Adding a new Visitor</h1>

h1 {
    text-align: center;
    border-bottom: double;
    border-left: double;
    border-right: double;
    width: 75%;
    margin: 0 auto;
    padding-top: 25px;
    padding-bottom: 25px;
    background-color: #C4CEDD;
    box-shadow: inset 0 20px 20px -20px #000000;

    text-decoration: underline;
    font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)

希望有所帮助.