块级元素(<aside>)不会显示?

时间:2016-08-26 21:09:56

标签: html css html5 css3 github

我的aside元素不会显示在我的网页上。在我的本地计算机上它显示正常,但当我将其上传到GitHub并将其复制/粘贴到CodePen时,它将不会显示自己。

它应该漂浮在#mainArticle的右侧,但它是空的。

https://blog.whatwg.org/javascriptHeres the site。缺少的元素看起来就像左侧的#relatedNews,两者几乎相同,只是浮动不同的边。

修改:所以我让它在FireFox上运行,我的手机上的Chrome无法在我的笔记本电脑的Chrome上运行

编辑2:嗯,我能够抓住我的姐妹笔记本电脑,它在她的手机上工作正常。我想它只是在我的浏览器上以不同的方式显示,这很奇怪,但我很高兴,只要它在所有人的浏览器上工作。

编辑3:感谢@Paulie_D,这是一个简单的关闭adblocker的东西,它的工作猜测你可以告诉我一个菜鸟仍然哈哈:p

*{
    margin: 0;
   
}
body{
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #FAFAFA;
}

hr{
    margin: 0px 51px 0px 51px;
    border-color: #FAFAFA;
}
h1{
    display: inline-block;
}


/*containers*/
.container{
    position: relative;
    margin: 5px;
}
/*text classes*/
.text-center{
    text-align: center;
}
.card-text{
    margin: 8px;
}

/*id's*/
#header{
    position: relative;
    top: 0;
    height: 45px;
    
}
/*floats left of #mainArticke*/
#relatedNews{
    float: left;
    position: relative;
    max-height: 500px;
    overflow: hidden;
    display: inline-block;
    
}
/*Center between #relatedNews and #ads*/
#mainArticle{
    display: inline-block;
    position: relative;
    margin:5px;
    
}
/*floats on right side of #mainArticle*/
#ads{
    float: right;
    position: relative;
    max-height: 500px;
    overflow: hidden;
    display: inline-block;
}

/*Colors*/
.white{
    background: #FFFFFF;
}

/*grid*/
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 65%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}

/*media*/
/*#mainArticle becomes absolute*/
@media screen and (max-width:1098px){
    #mainArticle{
        position: absolute;
    }
}
/*floats #relatedNews and #ads to right #mainArticle becomes absolute*/
@media screen and (max-width:1100px){

    #relatedNews{
        position: relative;
        float: right;
        display: block;
        width: 33.33%;
        
    }
    /*Clears below #relatedNews*/
    #ads{
        position: relative;
        display: block;
        clear: both;
        float: right;
        width: 33.33%;
        margin-top: 10px;
    }
}

/*#relatedNews and #ads sit below #mainArticle */
@media screen and (max-width:650px){
    #mainArticle{
        position: relative;
        width: 100%;
        display: block;
    }
    #relatedNews{
        float: none;
        display: inline-block;
        width: 49%;
    
    }
    #ads{
        display: inline-block;
        float: none;
        width: 49%;
        margin-left: 5px;
        
    }
}
/*Removes margin on smaller devices*/
@media screen and (max-width:500px){
    *{
        margin: 0;
        padding: 0;
    }
    .container{
        margin: 0;
    }
    #mainArticle{
        width:inherit;
        margin: 0;
    }
    #relatedNews{
        width: inherit;
        margin: 0;
    }
    #ads{
        width: inherit;
        margin: 0; 
    }
}
  <header class="white col-12" id="header">
        <h1>World Wide News!</h1>
    </header>
    <div class="container">
        <section class="col-8 white" id="mainArticle">
            <article class="card-text"><header><h2 class="text-center">Main Article!</h2></header>
                <p>And nu</p>
                <br><p>I'veast</p><br>
                <hr>
               <br>
                <p>Rain so poisoned, rainbows flowing. If me and Future hadn't made it with this rappin'. Yted more<br>

                <br>I've been fade'Cause I'm on one. Yeah, it's been too long. for real. A whole lot of girls, first flight from Poland<br>


                    When your famous girlI'd rather give that 15% to people I fuck with. It gets worse by the annual my career's like a how to manual. I'm on one<br>


                    <br>I can still get spoke in so long, probably put me in the past</p>
            </article>
        </section>

         <aside class="col-2 white" id="relatedNews"><header><h3 class="text-center">Related News!</h3></header>
        <article class="card-text">
            <p>
                Wallets, wallets,an see it in your eyes, you're angry. Forget 3 SUV'S, for, distress like refugees</p>
        </article>
    </aside>
        <aside class="col-2 white" id="ads">
            <header><h3 class="text-center">Sponsored By!</h3></header>
            <article class="card-text">
            <p>
                Wallets, wallets,e real live forever man. We prolly be out in Silicon tryna get our billions on. I can see it in your eyes, you're angry. Forget 3 SUV'S, for, distress like refugees</p>
        </article>
        </aside>
    </div>

0 个答案:

没有答案
相关问题