簡體   English   中英

CSS不起作用但是<style> working Div with Iframe

[英]CSS not working but <style> working Div with Iframe

內部格式可以在HTML上的標記中使用,但不能在鏈接的CSS文件中使用。 不知道為什么!

我嘗試過重命名課程並在線搜索解決方案,但找不到任何可以幫助我的東西。

<div class="Inner">
<iframe src="Form.php" name="Inside" allowTransparency="false" scrolling="yes" frameborder="1" width="100%" height="100%">
</iframe>

</div>
.Inner {
    color: black;
    position:fixed;
    width: 900px;
    height:900px;
    left: 300px;
    top:100px;
    border: 3px solid red;
}

我將其執行為向左300px,頂部100px,但這僅在將其包裝在HTML頁面上的標簽中時才起作用,但在鏈接的CSS文件上則不起作用(該CSS適用於所有其他標簽Ie Nav / Header。

編輯

完整的CSS樣式文件

/*HTML 5 display rule*/
address, article, aside, canvas, content, details, figcaption, figure, footer, header, hgroup, nav, menu, section, summary {
display:block
}

.Inner {
    color: black;
    position:fixed;
    width: 900px;
    height:900px;
    left: 300px;
    top:100px;
    border: 3px solid red;
}

table {
  border-collapse: collapse;
}

table, tr, th {
border: 1px solid black;
font-family:"League Spartan",Arial ;
}

h1{
    font-family:"League Spartan",Arial ;
    color:#fff;
    text-shadow:2px 2px 2px #000000;
}

@font-face {
    font-family: 'League Spartan';
    src: url('U:/Web Development/fonts/leaguespartan-bold.eot');
    src: url('U:/Web Development/fonts/leaguespartan-bold.eot?#iefix') format('embedded-opentype'),
         url('U:/Web Development/fonts/leaguespartan-bold.woff2') format('woff2'),
         url('U:/Web Development/fonts/leaguespartan-bold.woff') format('woff'),
         url('U:/Web Development/fonts/leaguespartan-bold.ttf') format('truetype'),
         url('U:/Web Development/fonts/leaguespartan-bold.svg#league_spartanbold') format('svg');
    font-weight: bold;
    font-style: normal;

}



nav {   
    font-family:League Spartan, Arial;
    float:left;
    color:black;
    width: 300px;
    height:800px;
    position:fixed;
    background-color:#17499b;
    top: 100px;
    left:0px;
    border-bottom-right-radius: 25px;
    border-bottom-left-radius: 25px;

    box-shadow:0px 0px 10px #000000 inset;
    /*-webkit-box-shadow:0px 5px 10px #000000 inset; /*safari*/

}
nav li{
        font-family:League Spartan, Arial;
    list-style-type:none;
}
nav ul li a{
        font-family:League Spartan, Arial;
    float:left;
    text-align:left;
    text-decoration:none;
    display:block;
    padding-top:50px;
    padding-right:20px;
    padding-bottom:20px;
    padding-left:20px;
    font-size:10px;
    /* css3 transition */
    -webkit-transition:all .5s;
    -o-transition-property:all;
    -o-transition-duration:.5s;
    -moz-transition-property:all;
    -moz-transition-duration:.5s;
    transition-property:all;
    transition-duration:.5s;

    border: .5px solid black;
    width:200px;
    display: inline;
    padding: 7.5px;
    box-shadow:0px 0px 5px #000000;
    -webkit-box-shadow:0px 0px 5px #000000; /*safari*/

}
nav li a:link{
    font-family:League Spartan, Arial;
        text-decoration:none;
    color:#333;

}
nav li a:visited{
    font-family:League Spartan, Arial;
        text-decoration:none;
    color:#333;
}
nav li a:hover{
    font-family:League Spartan, Arial;
    font-weight:bold;
    color:#0800ff;
    background-color:#5b9819;
    box-shadow: 0px 0px 5px #000000 inset;
    -webkit-box-shadow:0px 0px 5px #000000 inset; /* safari */
}
nav li a:active{
    font-family:League Spartan, Arial;
        font-weight:bold;
    color:#333;
    background-color:#000000;
}


header{
        font-family:League Spartan, Arial;
    line-height:25px;
    text-align :center;

    border:0px solid black;
    color:black;
    width:100%;
    height: var(--TitleHeight);
    background-color:  var(--maincolor);
    position:fixed;
    left:0px;
    top:0px;
    box-shadow:0px 0px 10px #000000 inset;
}


完整的HTML。

<!DOCTYPE html>
<html>

<head>
<title> RESOURCE FORGE </title>

<meta name="keywords" content="KEY WORD1, KEYWORD 2, KEY WORD3" />
<meta name="description" content ="Description for the website" />
<meta name="aurthor" content="Chris Livermore" />

<link rel="stylesheet" type="text/css" href="stylesheet1.CSS" />

</head>
<body>

    <div class="Inner">

        <iframe src="Form.php" name="Inside" allowTransparency="false" scrolling="yes" frameborder="1" width="100%" height="100%">
        </iframe>

    </div>

    <nav>
        <h2>NAVIGATION</h2>
        <h4>CHAPTER 1</h4>
        <ul>
            <li><a href="Form.php" target="Inside">USER INPUT</a> </li>
            <li><a href=# target="Inside"></a> </li>
            <li><a href="Contact_Form.php" target="Inside">Add New Contact</a> </li>
            <li><a href="phonelistFN.php" target="Inside">View Phone List</a> </li>
            <li><a href="easyinporter.php" target="Inside">EASY INPORTER</a> </li>
            <li><a href="C1 T6 - Images.html" target="Inside">T6 - Images</a> </li>
            <li><a href="C1 T7 - Tables.html" target="Inside">T7 - Tables</a> </li>
        </ul>
    </nav>
    <header>

        <h1>RESOURCE FORGE</h1>
        <p>This Site is currently under development- some features may be missing or partially completed </p>
    </header>

</body>


</html>

如您所見,我正在使用導航欄在Inner div中加載新頁面。 無法理解為什么它不能在樣式標簽中正常工作,而在其他一切都正常的情況下卻不能在CSS文件中正常工作嗎?

這是由於Chrome緩存。 清除它,格式化工作正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM