Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>navbar</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0-12/css/all.min.css">
    <link rel="stylesheet" href="css/all.css">
</head>

<body>
    <div class="navbar">
        <div class="container">
            <div class="logo">
                <a href="#">
                    <i class="fas fa-music"></i>MusicIsGood
                </a>
            </div>

            <ul class="menu">
                <li><a href="#" target="_blank">華語</a></li>
                <li><a href="#" target="_blank">西洋</a></li>
                <li><a href="#" target="_blank">東洋</a></li>
                <li><a href="#" target="_blank">鄉村</a></li>
            </ul>
        </div>
        <!-- <div class="clearfix"></div> -->
    </div>
    <!-- navbar end -->

    <div class="header">
        <div class="container">
            <div class="text-area">
                <div class="text">
                    <h1 class="title">
                        永垂不朽的鐵人經典
                    </h1>
                </div>
            </div>
        </div>
    </div>
    <!-- header end -->

    <section1>
        <div class="content">
            <div class="container">
                <ul>
                    <li>
                        <h2>本週主打星</h2>
                        <img
                            src="https://images.unsplash.com/photo-1474752651386-dc296d69dc90?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80">
                        <p>
                            嚴格海外你知道不可以,水平指揮軟件執行時間這個流行依法事實上常常當前,她的威望如下上傳詢問改,更新用來情感動漫才是引,之後感興趣取得足夠加上遼寧,印象他對失望壓力看著包裝每個人,天天自從騎士引用手冊周圍期待進一步電話提前很久簡介測試運,某個一口氣採取家裡還沒有確認正確高效。<br>
                            <a href="#">(繼續閱讀...)</a>
                        </p>
                    </li>
                    <li>
                        <h2>本週排行</h2>
                        <img
                            src="https://images.unsplash.com/photo-1483412033650-1015ddeb83d1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1353&q=80">
                        <p>
                            我市維護不對星座損失思路擴大教,經理不用研究所接口股權不斷有,添加對此水平供求實在發現無疑研究生來看一件他也總體儘量及其德,由於習慣就在還可以因而受到時,等級上帝聽說權益追求新,下了西方因素熱線下降節省差不多藥物宣,也沒考察不可能肯定犯罪鼓勵時候依舊原來有,重大本類一份讓他印象身影進入資,先進高中。<br>
                            <a href="#">(繼續閱讀...)</a>
                        </p>
                    </li>
                    <li>
                        <h2>本週冠軍歌曲</h2>
                        <img
                            src="https://images.unsplash.com/5/unsplash-kitsune-4.jpg?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80">
                        <p>
                            對待環保訓練程度條件太陽手,創意現象統一您可以觀看便是,一下子自然太陽考生每次權利一段時間立刻反映全身男女極,在此先生有很多轉貼處罰缺乏溫度操作攻擊,自由聯繫方式海外如今是以請您地圖可能會經銷商少,職工請大家是怎麼極大流行上升來,開發近年來通道市民品種開口天然考研歐洲,醫藥長大能量開關整合列表消息上。<br>
                            <a href="#">(繼續閱讀...)</a>
                        </p>
                    </li>
                </ul>
            </div>
        </div>
    </section1>
</body>

</html>
              
            
!

CSS

              
                *{
    box-sizing:border-box}
  p{
    color: #333;
    line-height: 1.5;
  }
  
  
  $lead-color:#ffc078;
  
  .navbar{
      background-color: #333;
      height: 50px;
  }
  .container{
      width: 1024px;
      margin: 0 auto;
      
  }
  
  .logo{
      display:inline;
      a{
          color:$lead-color;
          margin-top: 1em;
          margin-bottom: 1em;
          text-decoration: none;
          line-height:50px;
          font-size: 24px;
      }
      .fa-music{
          color:$lead-color;
          margin-right: 1em;
         }
  
  }
  .menu{
      float:right;
      li{
          float:left;
      }
          a{
          display:flex;
          margin-right: 10px;
          color:$lead-color;
          text-decoration: none;
          line-height:50px;
          padding: 0 1em;
      }
      a:hover{
          background-color:  $lead-color;
          color:#333
      }
  }
  
  .header{
      background-image: url(https://images.unsplash.com/photo-1470229722913-7c0e2dbbafd3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80);
      max-width:100%;
      height: 420px;
      background-repeat: no-repeat;
      background-size:cover;
      background-position: center center;
      .text{
          text-align:center;
      }
    }
  
    .text-area{
        padding-top: 150px;
    }
  
    .text{
      margin:0 auto;
      color:#fff;
      background-color: #000;
      opacity:0.6;
      padding:2em;
      
      .title{
          font-size:50px;
          font-weight: bold;
                 }
    }
  
    .content{
        margin-top: 20px;      
        h2{
            font-size:24px;
            color: $lead-color;
            margin-bottom: 1em;
            font-weight: bold;
            text-align: center;
        }
        li{
          width: 31.33333%;
          margin-right: 1%;
          margin-left: 1%;
          margin-bottom: 1em;
          float: left;
        }
        img{
          max-width: 100%;
          height: auto;
          margin-bottom: 1em;
        }
        a{
          text-decoration: none;
          color: blue;
        }
    }

              
            
!

JS

              
                
              
            
!
999px

Console