Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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, shrink-to-fit=no">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css">
    <link rel="stylesheet" href="css/price.css">
    <title>Room_price</title>
</head>

<body>
    <div class="container">
        <div class="room__price">
            <div class="room__price__info">
                <a href="hotel_index.html">
                    <p><i class="fas fa-chevron-left"></i>
                        <span>查看其它房型</span>
                    </p>
                </a>

            </div>

            <div class="room__price__btn">
                <p class="price"><strong>$1,380</strong>
                    <span>/</span>
                    <span>1晚</span>
                </p>
                <button class="btn">
                    <p>Booking now</p>
                </button>

                <div class="change__room__btn">
                    <p><i class="far fa-circle"></i></p>
                    <p><i class="far fa-circle"></i></p>
                    <p><i class="far fa-circle"></i></p>
                </div>
            </div>

        </div>
        <!-- room__price end -->

        <div class="room__content">
            <div class="room__name">
                <h2>Single Room</h2>
                <p>1人・ 單人床・ 附早餐・衛浴1間・18平方公尺</p>

            </div>
            <!-- room__name end -->

            <div class="room__priceInfo">
                <p>平日(一~四)價格:1380 / 假日(五〜日)價格:1500 <br>
                    入住時間:15:00(最早)/ 21:00(最晚)<br> 退房時間:10:00</p>
                <ul class="room__content__info">
                    <li>
                        <p>・單人間僅供一位客人使用。 </p>
                    </li>
                    <li>
                        <p>・臥室配有單人床和私人浴室。</p>
                    </li>
                    <li>
                        <p>・您需要的一切為您準備:床單和毯子,毛巾,肥皂和洗髮水,吹風機。</p>
                    </li>
                    <li>
                        <p>・房間裡有 AC,當然還有 WiFi。</p>
                    </li>
                </ul>
            </div>
            <!-- room__priceInfo -->

            <div class="room__iconInfo">
                <div class="icon breakfast">
                    <img src="img/icon/surface1.svg" alt="">
                    <p>早餐</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon poolside" >
                    <img src="img/icon/icons8-poolside_bar.svg" alt="">
                    <p>Mini Bar</p>
                    <i class="fas fa-window-close"></i>
                </div>

                <div class="icon surface">
                    <img src="img/icon/surface3.svg" alt="">
                    <p>Service</p>
                    <i class="fas fa-window-close"></i>
                </div>

                <div class="icon wifi">
                    <img src="img/icon/surface-wifi.svg" alt="">
                    <p>Wifi</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon kids">
                    <img src="img/icon/kids.svg" alt="">
                    <p>Kids</p>
                    <i class="fas fa-window-close"></i>
                </div>

                <div class="icon telephone">
                    <img src="img/icon/telephone.svg" alt="">
                    <p>電話</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon view">
                    <img src="img/icon/view.svg" alt="">
                    <p>view</p>
                    <i class="fas fa-window-close"></i>
                </div>

                <div class="icon icebox">
                    <img src="img/icon/icebox.svg" alt="">
                    <p>冰箱</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon sofa">
                    <img src="img/icon/sofa.svg" alt="">
                    <p>Sofa</p>
                    <i class="fas fa-window-close"></i>
                </div>

                <div class="icon pets">
                    <img src="img/icon/pets.svg" alt="">
                    <p>Pets</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon nosmoking">
                    <img src="img/icon/nosmoke.svg" alt="">
                    <p>禁菸</p>
                    <i class="fas fa-check-circle"></i>
                </div>

                <div class="icon aircondition">
                    <img src="img/icon/aircondition.svg" alt="">
                    <p>空調</p>
                    <i class="fas fa-check-circle"></i>
                </div>
            </div>
            <!-- room__iconInfo end -->

            <div class="room__dateorder">
                <h3>空房狀態查詢</h3>
            </div>
            <div class="room__calendar">
                <div class="room__calendar__left">
                    <div class="room__calendar__month">
                        <a href="#" class="arrow_left"><i class="fas fa-angle-left"></i></a>
                        <p class="month">August 2019</p>
                    </div>
                    <table class="room__calendar__table">

                        <tr>
                            <th>Sun</th>
                            <th>Mon</th>
                            <th>Tue</th>
                            <th>Mar</th>
                            <th>Thu</th>
                            <th>Fri</th>
                            <th>Sat</th>
                        </tr>

                        <tr>
                            <td>28</td>
                            <td>29</td>
                            <td>30</td>
                            <td>31</td>
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>

                        <tr>
                            <td>4</td>
                            <td>5</td>
                            <td>6</td>
                            <td>7</td>
                            <td>8</td>
                            <td>9</td>
                            <td>10</td>
                        </tr>

                        <tr>
                            <td>11</td>
                            <td>12</td>
                            <td>13</td>
                            <td>14</td>
                            <td>15</td>
                            <td>16</td>
                            <td>17</td>
                        </tr>

                        <tr>
                            <td>18</td>
                            <td>19</td>
                            <td class="green">20</td>
                            <td class="green">21</td>
                            <td class="green">22</td>
                            <td class="green">23</td>
                            <td class="green">24</td>
                        </tr>

                        <tr>
                            <td class="green">25</td>
                            <td class="green">26</td>
                            <td class="green">27</td>
                            <td class="green">28</td>
                            <td class="green">29</td>
                            <td class="green">30</td>
                            <td>1</td>
                        </tr>

                    </table>

                </div>
                <div class="room__calendar__right">
                    <div class="room__calendar__month">
                        <p class="month">September 2019</p>
                        <a href="#" class="arrow_right"><i class="fas fa-angle-right"></i></a>
                    </div>
                    <table class="room__calendar__table">

                        <tr>
                            <th>Sun</th>
                            <th>Mon</th>
                            <th>Tue</th>
                            <th>Mar</th>
                            <th>Thu</th>
                            <th>Fri</th>
                            <th>Sat</th>
                        </tr>

                        <tr>
                            <td class="green">2</td>
                            <td class="green">3</td>
                            <td class="green">4</td>
                            <td class="green">5</td>
                            <td class="green">6</td>
                            <td class="green">7</td>
                            <td class="green">8</td>
                        </tr>

                        <tr>
                            <td class="green">9</td>
                            <td class="green">10</td>
                            <td class="green">11</td>
                            <td class="green">12</td>
                            <td class="green">13</td>
                            <td class="green">14</td>
                            <td class="green">15</td>
                        </tr>

                        <tr>
                            <td class="green">16</td>
                            <td class="green">17</td>
                            <td class="green">18</td>
                            <td class="green">19</td>
                            <td class="green">20</td>
                            <td class="green">21</td>
                            <td class="green">22</td>
                        </tr>

                        <tr>
                            <td class="green">23</td>
                            <td class="green">24</td>
                            <td class="green">25</td>
                            <td class="green">26</td>
                            <td class="green">27</td>
                            <td class="green">28</td>
                            <td class="green">29</td>
                        </tr>

                        <tr>
                            <td class="green">30</td>
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                            <td>4</td>
                            <td>5</td>
                            <td>6</td>
                        </tr>

                    </table>
                </div>
            </div>


        </div>


    </div>


</body>

</html>
              
            
!

CSS

              
                body {
  font-family: Noto Sans CJK TC;
}

$primary-color: #38470b;

.container {
  max-width: 1280px;
  height: auto;
  margin: 0 auto;
  display: flex;
}

a {
  text-decoration: none;
}

// layout

.room__price {
    width: 40%;
    background-image: url(https://images.unsplash.com/photo-1526880792616-4217886b9dc2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80);
    background-size: cover;
    background-position: center center;
   
    .room__price__info {
        padding-top: 90px;
        padding-left: 10%;

        a {
            color: $primary-color;
        }
    }

    .room__price__btn {
        padding-top: 600px;
        text-align: center;
        color: $primary-color;

        .price {
            font-size: 36px;

        }

        span {
            font-size: 20px;
        }

        .btn {
            padding: 8.5px 59px;
            margin-top: 20px;
            background-color: $primary-color;
            border: 1px solid $primary-color;

            &:hover {
                background: darken($primary-color, 10%) // 顏色變深的語法
            }

            p {
                color: #fff;
                font-size: 20px;
            }

        }

        .change__room__btn {
            display: flex;
            text-align: center;
            margin-top: 20px;
            justify-content: center;
            padding-bottom: 20px;

            .far {
                color: $primary-color;
                padding: 0px 5px;
            }
        }
    }
}


.room__content {
    width: 60%;
    padding-left: 30px;
    padding-right: 30px;

    .room__name {
        display: inline-flex;

        h2 {
            font-size: 40px;
            color: $primary-color;
            padding-top: 107px;
        }

        p {
            display: inline-block;
            font-size: 14px;
            color: $primary-color;
            padding: 128px 50px 0 50px;
        }

    }

    .room__priceInfo {
        font-size: 14px;
        line-height: 1.5;
        padding-left: 0;
        padding-top: 30px;

    }

    .room__content__info {
        padding-top: 30px;

        li {
            font-size: 14px;
            color: $primary-color;
            line-height: 1.8;
        }
    }

    .room__iconInfo {
        padding-top: 30px;
        display: flex;
        flex-wrap: wrap;
        color: $primary-color;

        .icon {
            position: relative;
            display: flex;
            flex-direction: column;
            // 垂直排列
            margin: 4% 4% 0 4%;
            width: 40px;
            // 設定固定寬度,讓 icon 不會因為內容寬度不同而有不同寬度。

            img {
                flex: auto;
            }

            p {
                font-size: 10px;
                color: $primary-color;
                text-align: center;
                font-size: 10px;
                padding-top: 5px;
            }

            .fas {
                position: absolute;
                top: 0px;
                right: -25px;
                color: $primary-color;
            }
        }

        .poolside,
        .surface,
        .kids,
        .view,
        .sofa {
            filter: opacity(0.5);
            // filter 濾鏡屬性
            // http://blog.shihshih.com/css-filter/
        }
    }

    .room__dateorder {
        margin-top: 30px;

        h3 {
            color: $primary-color;
            font-weight: bold;
            margin-bottom: 10px;
            font-size: 18px;
        }

    }

    .room__calendar {
        border: 1px solid $primary-color;
        display: flex;
        // 橫排並排

        .room__calendar__left,
        .room__calendar__right {
            width: 95%;
            flex-direction: column;
            // 使月曆直向排列
            // 參考文章:https://wcc723.github.io/css/2017/07/21/css-flex/
            padding: 4%;
        }

        .room__calendar__month {
            display: flex;

            .fas,
            .month {
                color: $primary-color;
                font-size: 16px;

            }

            .month {
                display: inline;
                flex: auto;
                // 相關文章參考 https://wcc723.github.io/css/2017/07/21/css-flex/
                text-align: center;
                font-weight: bold;

            }
        }

        .room__calendar__table {
            margin-top: 20px;
            text-align: center;
            font-size: 14px;

            th {
                padding: 10px;
                color: #888888;
                border-bottom: 1px solid #888;
            }

            td {
                padding: 10px;
                color: #cacaca;
            }

            .green {
                color: $primary-color;
                font-size: bold;
            }
        }
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console