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 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

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

              
                <head>
  <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
</head>

<body>
    <header>
        <div class="l_header">
            <div class="site_title">
                <p>SITE-TITLE</>
            </div>
            <div class="top_manu">
                <ul>
                    <li>MENU</li>
                    <li>MENU</li>
                    <li>MENU</li>
                </ul>
            </div>
        </div>
    </header>
    <div class="wrapper">
        <div class="main_contents">
            <div class="page_title">
                <h1>PAGE TITLE</h1>
            </div>

            <div class="shingle_text">
            
                <p>目次前のリード文が入る、目次前のリード文が入る、目次前のリード文が入る</p>
                <p>目次前のリード文が入る、目次前のリード文が入る</p>
                <p>目次前のリード文が入る</p>
            
            </div>

            <div class="l_toc">
                <label for="tocopen">目次-OPEN</label>
                <input id="tocopen" type="checkbox">
                <ol class="toc_container">
                    <li>目次.1
                        <ol>
                            <li>目次1.1</li>
                            <li>目次1.2</li>
                        </ol>
                    </li>
                    <li>目次.2
                        <ol>
                            <li>目次2.1</li>
                            <li>目次2.2</li>
                        </ol>
                    </li>
                    <li>目次.3
                        <ol>
                            <li>目次3.1</li>
                            <li>目次3.2</li>
                        </ol>
                    </li>
                </ol>
            </div>

            <!--section-->

            <div class="shingle_text">

            <section>
                <h2>サンプル見出し.1</h2>
                <p>目次以降の文章が入る、目次以降の文章が入る、目次以降の文章が入る</p>
                <p>目次以降の文章が入る、目次以降の文章が入る</p>
                <p>目次以降の文章が入る</p>
            </section>
        </div>
        </div>
    </div>
    <footer></footer>
</body>
              
            
!

CSS

              
                *,*::before,::after{box-sizing: border-box;}

/*****リセット*****/
h1{margin: 0;}
ul,li{list-style: none;}
a{text-decoration: none;}

body{
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Helvetica Neue", HelveticaNeue, YuGothic, "Yu Gothic Medium", "Yu Gothic", Verdana, Meiryo, sans-serif;
    margin: 0;
}

/*****ヘッダーレイアウト*****/

.l_header{
    background-color: burlywood;
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
}
.site_title{
    background-color: antiquewhite;
    width: 100%;
    max-width: 440px;
    text-align: center;
    font-size: 1.2em;
}

.top_manu{
    width: 100%;
    padding: 10px;
}

.top_manu ul{
    display: flex;
    justify-content: space-evenly;
    list-style: none;
}
.top_manu li{
    background-color: antiquewhite;
    text-align: center;
    padding: 20px;
}

/*****メインコンレイアウト*****/

.wrapper{
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}
.page_title{
    padding: 30px;
    text-align: center;
}
.main_contents{
    background-color: antiquewhite;
    padding: 50px 0px;
}

/*****テキストレイアウト*****/
.shingle_text{
    background-color: floralwhite;
    margin-top: 95px;
    padding: 30px;
}

/*****目次*****/

.l_toc{
    width: 95%;
    max-width: 500px;
    margin: 30px auto;
    position: relative;
    top: 38px;
    left: 0;
}
.toc_container{
    background-color: #fff;
    width: 100%;
}
.l_toc label{
    background-color: tan;
    padding: 10px;
    z-index: 999;
    position: absolute;
    top: -40px;
    left: 0;
}

/*****
目次ボタンクリックでtoc_containerを開く
******/

#tocopen:checked + .toc_container {
    color: #242424;
    display: block;
    margin: 30px auto;
    padding: 45px;
    
    border: 4px solid tan;   
}
.toc_container{
    display: none;
}
.l_toc input[type="checkbox"]{
    display: none;
}

/*****目次リスト先頭に番号*****/

.toc_container ol>li::before {
	color: rgb(110, 20, 255);
	font-family: "Font Awesome 5 Free";
    content: '\f105';
	padding-right: 8px;
}
.toc_container>li::before {
	color: deeppink;
	font-family: "Font Awesome 5 Free";
    content: '\f105';
	padding-right: 8px;
}
.toc_container ol>li{
    margin: 10px 0px;
}

/*****メディアクエリ*****/

@media screen and (max-width: 650px){
    .l_header{
        display: block;
        padding: 30px;
        height: auto;
        text-align: center;
    }
    .top_manu ul{
        display: flex;
        width: 100%;
        justify-content: space-around;
        margin-top: 50px;
        padding: 0;
    }
    .top_manu{
        width: 100%;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console