代码无法在服务器上运行?

时间:2016-03-23 11:37:20

标签: html css

在我的电脑上它运行正常,但是一上传它就会停止工作,我不知道为什么。查看链接,看看它是一个灾难性的错误。

    http://www.coachella.eu/

我不明白为什么它不会起作用,因为它来自这里; https://css-tricks.com/seamless-responsive-photo-grid/

    <html>
    <head>
            <title>Coachella - Images</title>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
            <link rel="stylesheet" href="stylesheets/style.css">    
    </head>


    <body>
        <?php include_once("analyticstracking.php") ?>
        <section id="photos">
            <img src="images/2015/1.jpg" alt="Hipster Girl">
            <img src="images/2015/2.jpg" alt="Beyonce">
            <img src="images/2015/3.jpg" alt="Azealia banks">
            <img src="images/2015/4.jpg" alt="Hipster">
            <img src="images/2015/5.jpg" alt="Girlfriends">
            <img src="images/2015/6.jpg" alt="Fake Tan">
            <img src="images/2015/7.jpg" alt="Paris Hilton?">
            <img src="images/2015/8.jpg" alt="Some C List Celebrity">
            <img src="images/2015/9.jpg" alt="Group of Californian girls">
            <img src="images/2015/10.jpg" alt="Sunset">
            <img src="images/2015/11.jpg" alt="Pouting & Sun Tans">
            <img src="images/2015/12.jpg" alt="Giant Spaceman">
            <img src="images/2015/13.jpg" alt="Girl with American Flag">
            <img src="images/2015/14.jpg" alt="4 tanned girls, one white one">
            <img src="images/2015/15.jpg" alt="Girls in white dresses">
            <img src="images/2015/16.jpg" alt="Showing skin and american flag">
            <img src="images/2015/18.jpg" alt="Cute couple">
            <img src="images/2015/19.jpg" alt="The crowd">
            <img src="images/2015/20.jpg" alt="Big Wheel">
            <img src="images/2015/21.jpg" alt="Girls eating">
            <img src="images/2015/22.jpg" alt="Grassy field">
            <img src="images/2015/24.jpg" alt="Packed crowd">
            <img src="images/2015/25.jpg" alt="Couples holding hands">
            <img src="images/2015/26.jpg" alt="Over Accessorised">
            <img src="images/2015/27.jpg" alt="Kardashian Girls">
            <img src="images/2015/28.jpg" alt="One of the Kardashians">
            <img src="images/2015/30.jpg" alt="Girl with open dress">
            <img src="images/2015/31.jpg" alt="Breaking Bad's Aaron Paul">
            <img src="images/2015/33.jpg" alt="Drone shot of crowd">
            <img src="images/2015/34.jpg" alt="Paris Hilton">
        </section>
    </body>

CSS在我的电脑上工作正常!!

body {
        padding: 0px;
        @apply(--layout-fullbleed);
        @apply(--paper-font-common-base);
    }

    #photos {
        /* Prevent vertical gaps */
        line-height: 0;

        -webkit-column-count: 5;
        -webkit-column-gap:   0px;
        -moz-column-count:    5;
        -moz-column-gap:      0px;
        column-count:         5;
        column-gap:           0px;  
    }

    #photos img {
        /* Just in case there are inline attributes */
        width: 100% !important;
        height: auto !important;
        margin-left: auto;
        margin-right: auto;
    }

    @media (max-width: 1200px) {
        #photos {
            -moz-column-count:    5;
            -webkit-column-count: 5;
            column-count:         5;
        }
        #photos img {
            /* Just in case there are inline attributes */
            max-width:  width: 100% !important;
        }
    }
    @media (max-width: 1000px) {
        #photos {
            -moz-column-count:    3;
            -webkit-column-count: 3;
            column-count:         3;
        }
    }
    @media (max-width: 800px) {
        #photos {
            -moz-column-count:    2;
            -webkit-column-count: 2;
            column-count:         2;
        }
    }
    @media (max-width: 400px) {
        #photos {
            -moz-column-count:    1;
            -webkit-column-count: 1;
            column-count:         1;
        }
    }

编辑:服务器上的文件是100%,我已删除它们并重新上传所有文件!不知道为什么它找不到它们,因为链接直接与文件有关。

2 个答案:

答案 0 :(得分:0)

为了使图像在Web上可见,它们需要在服务器上提供您提到的路径文件...所以基本上您需要确保这些图像在服务器上可用。这应该解释一切:http://www.htmlgoodies.com/primers/html/article.php/3478181

答案 1 :(得分:0)

我猜测的所有当前图像都存储在本地计算机上。

如果您也无法上传图片,那么您将无法看到它们!

我建议复制正在使用的路径,然后复制整个文件夹。

因此,如果您在本地,计算机上,文件夹中保存了项目,则将该文件夹的整个内容上传到您的public_html文件夹。

小小的图片&#39;您正在查看表明您的文件通常无法找到。

希望你能解决它!