簡體   English   中英

CSS代碼不起作用

[英]CSS code doesn't work

我使用CSS3工具包生成代碼,但是當我將它粘貼到我的編輯器中時,它不會返回形狀,事實上,它不會返回任何屏幕上的內容。 請有人找到我出錯的地方。 它與css文件的鏈接方式無關,因為它適用於我的其他css代碼。 我從App Store購買的CSS3 Toolkit生成的這個特殊代碼不起作用。

HTML:

 <!DOCTYPE HTML>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="indexcss.css">
        <script type="text/javascript" href="dist/js/bootstrap.js"></script>
    </head>
    <body>
        <div class="ToolKitStyle"></div>
    </body>
</html>

CSS:

    .ToolKitStyle{
    background-color: #2EC0FE;
    -moz-border-radius: 34px;
    -webkit-border-radius: 34px;
    border-radius: 34px;
    -moz-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    -webkit-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    background-image: -o-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -moz-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -webkit-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -ms-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
}

你需要在你的CSS中添加寬度和高度

.ToolKitStyle{
    background-color: #2EC0FE;
    -moz-border-radius: 34px;
    -webkit-border-radius: 34px;
    border-radius: 34px;
    -moz-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    -webkit-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    background-image: -o-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -moz-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -webkit-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -ms-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    width:100px;
    height:100px;
}

你的JS沒有正確鏈接。 使用src而不是href

<script type="text/javascript"  src="dist/js/bootstrap.js"></script>

關於你的CSS問題 -

你沒有任何內容,這就是你css看起來不起作用的原因。

這是高度,寬度定義

演示http://jsfiddle.net/kevinPHPkevin/73t6R/

你需要把東西放在或設置寬度/高度: http//jsfiddle.net/2qyEP/

.ToolKitStyle{
    width: 200px;
    height: 200px;
    background-color: #2EC0FE;
    -moz-border-radius: 34px;
    -webkit-border-radius: 34px;
    border-radius: 34px;
    -moz-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    -webkit-box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    box-shadow:inset 0px 4px 9px rgba(0,0,0,1);
    background-image: -o-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -moz-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -webkit-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: -ms-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
    background-image: linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%);
}

暫無
暫無

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

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