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

              
                <div class="menu">
    <div class="menu-topic">常見問題</div>

    <div class="submenu">

        <div class="fill" draggable="true">
            <p>性別?</p>
            <ul class="que d-none edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您的性別?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="男" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="女" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>
            <div class="btns d-none">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>
        </div>

        <div class="fill" draggable="true">
            <p>出生年?</p>
            <ul class="que d-none edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您的出生年區間?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="2000-2009" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="1990-1999" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="1980-1989" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="1970-1979" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="1960-1969" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="1950-1959" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>
            <div class="btns d-none">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>
        </div>

        <div class="fill" draggable="true">
            <p>教育程度?</p>
            <ul class="que d-none edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您的教育程度?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="碩士或碩士以上" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="大學" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="高中" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="國中或國中以下" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>

                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>
            <div class="btns d-none">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>
        </div>


        <div class="fill" draggable="true">
            <p>居住地點?</p>
            <ul class="que d-none edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您目前居住的地點?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="北部" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="中部" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="南部" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="東部" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>
            <div class="btns d-none">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>
        </div>


        <div class="fill" draggable="true">
            <p>職業?</p>
            <ul class="que d-none edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您目前的職業?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="農林漁牧業" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="工商服務業" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>

                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>
            <div class="btns d-none">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>
        </div>


    </div>

</div>



<div class="container">
    <div class="topic">
        <h4>
            <input type="text" value="遊憩方法:在此步道遊憩經驗與花費" disabled>
        </h4>
        <div class="topic-btns">
            <button name="edit-topic" class="btn btn-success fas fa-pencil-alt"></button>
            <button name="add-topic" class="btn btn-success fas fa-copy"></button>
            <button name="delete-topic" class="btn btn-success far fa-trash-alt"></button>
        </div>
    </div>

    <div class="questionaire">

        <div class="fill" draggable="true">
            <p class="d-none">右側標題</p>
            <ul class="que edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="最近一年內您到此步道的次數?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="一次" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="兩次" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="radio" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="三次" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>

            <div class="btns">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>

        </div>


        <div class="fill" draggable="true">
            <p class="d-none">右側標題</p>
            <ul class="que edit">

                <li class="question">
                    <p class="num"></p>
                    <input type="text" name="topic" disabled value="您從何處獲得步道的相關資訊?">

                    <button name="necessary" class="btn btn-sm">必填</button>


                    <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                        <option value="0">答題方式</option>
                        <option value="1">單選</option>
                        <option value="2">複選</option>
                        <option value="3">簡答</option>
                        <option value="4">段落</option>
                    </select>
                </li>
                <li>
                    <input type="checkbox" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="網路" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="checkbox" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="報章雜誌" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="checkbox" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="電視媒體" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <input type="checkbox" name="option1">
                    <label for="option">
                        <input disabled type="text" name="option" value="其他" />
                    </label>
                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                </li>
                <li>
                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                </li>
            </ul>

            <div class="btns">
                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
            </div>

        </div>

        <!-- <div class="fill" draggable="true">
                            <p class="d-none">右側標題</p>
                            <ul class="que edit">

                                <li class="question">
                                    <p class="num"></p>
                                    <input type="text" name="topic" disabled value="問卷標題">

                                    <button name="necessary" class="btn btn-sm">必填</button>
                                    

                                    <select id="answerOptions" name="@Model.QGlist[i].QList[j].QType" onchange="optionChange(this)" class="d-none" disabled>
                                        <option value="0">答題方式</option>
                                        <option value="1">單選</option>
                                        <option value="2">複選</option>
                                        <option value="3">簡答</option>
                                        <option value="4">段落</option>
                                    </select>
                                </li>
                                    <li>
                                    <input type="radio" name="option1">
                                    <label for="option"><input disabled type="text" name="option" value="12345" /></label>
                                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                                    </li>
                                    <li>
                                    <input type="radio" name="option1">
                                    <label for="option"><input disabled type="text" name="option" value="678910" /></label>
                                    <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                                    </li>
                                    <li>
                                    <a class="add-option" title="新增選項" style="text-decoration:underline;">新增選項</a>
                                    <button name="delete-que" title="刪除問題" class="btn fas fa-trash-alt m-1 float-right"></button>
                                    <button name="add-que" title="複製問題" class="btn fas fa-copy m-1 float-right"></button>
                                    <button name="add-new-que" title="增加問題" class="btn fas fa-plus-square m-1 float-right"></button>
                                    </li>
                                        </ul>

                            <div class="btns">
                                <button name="edit-que" class="btn fas fa-pencil-alt"></button>
                            </div>

                        </div>


</div> -->

        <div class="topic">
            <h4>
                <input type="text" value="再訪意願:未來再次造訪的意願" disabled>
            </h4>
            <div class="topic-btns">
                <button name="edit-topic" class="btn btn-success fas fa-pencil-alt"></button>
                <button name="add-topic" class="btn btn-success fas fa-copy"></button>
                <button name="delete-topic" class="btn btn-success far fa-trash-alt"></button>
            </div>
        </div>

        <div class="questionaire">

            <div class="fill" draggable="true">
                <p class="d-none">右側標題</p>
                <ul class="que edit">

                    <li class="question">
                        <p class="num"></p>
                        <input type="text" name="topic" disabled value="未來願意再次造訪本園區嗎?">

                        <button name="necessary" class="btn btn-sm">必填</button>


                        <select id="answerOptions" name="" onchange="optionChange(this)" class="d-none" disabled>
                            <option value="0">答題方式</option>
                            <option value="1">單選</option>
                            <option value="2">複選</option>
                            <option value="3">簡答</option>
                            <option value="4">段落</option>
                        </select>
                    </li>
                    <li>
                        <input type="checkbox" name="option1">
                        <label for="option">
                            <input disabled type="text" name="option" value="願意" />
                        </label>
                        <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                    </li>
                    <li>
                        <input type="checkbox" name="option1">
                        <label for="option">
                            <input disabled type="text" name="option" value="不願意" />
                        </label>
                        <button name="delete-li" title="刪除選項" class="btn far fa-times-circle"></button>
                    </li>
                </ul>

                <div class="btns">
                    <button name="edit-que" class="btn fas fa-pencil-alt"></button>
                </div>

            </div>
        </div>




<div class="content" style="display: none"></div>
              
            
!

CSS

              
                * {
    /*background: darksalmon;*/
    list-style: none;
}


.menu {
    display: inline-block;
    float: right;
    position: fixed;
    right: 0;
    top: 40px;
}

.menu-topic {
    background-color: #f2f9dd;
    font-size: 1.2em;
    color: #327a2a;
    width: 150px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
}

.menu .fill p {
    margin-bottom: 0;
    font-size: 0.85em;
}


.menu .fill {
    width: 150px;
    cursor: pointer;
    display: block;
    background-color: #fcfcfc;
    border-bottom: 1px #f2f9dd dotted;
    /*line-height: 26px;*/
    background-color: white;
    padding: 5px 10px;
    /*cursor: move;*/
}

.empty {
    position: absolute;
    /*display: inline-block;*/
    height: 40px;
    width: 42em;
    /*margin: 10px;*/
    background-color: transparent;
    /*margin-top: -20px;*/
    z-index: 5;
    /*background-color: red;*/
    /*cursor: move;*/
}


.empty-box {
    display: block;
    height: 10px;
    width: 400px;
    margin: 10px;
    /*border: solid 3px salmon;*/
    background-color: salmon;
}

.full {
    display: block;
    height: 40px;
    width: 400px;
    margin: 10px;
    border: solid 3px salmon;
    background: white;
}

.hovered {
    position: relative;
    display: inline-block;
    background: #f4f4f4;
    /*border-style: dashed;*/
    height: 200px;
    width: 42em;
    margin-top: 0px;
    /*margin: 10px;*/
}



.container {
    width: 45em;
    float: left;
    margin-top: 20px;
    /*background-color: green;*/
}

.container .topic {
    width: 100%;
    height: 3.3em;
    color: white;
    border-radius: 5px;
    background-color: #327a2a;
    margin-top: 16px;
    padding-top: 0.6em;
    border: 2px solid #327a2a;
}


.container .topic h4 {
    /*line-height: 2em;*/
    font-size: 1.2em;
    padding-left: 10px;
}

#required {
    display: inline-block;
}

.container .new-topic {
    width: 42em;
    height: 2.5em;
    color: #327a2a;
    border-radius: 5px;
    padding: 4px;
    line-height: 0px;
    border: 2px dashed #327a2a;
    background-color: white;
    /*margin-top: -8px;*/
    margin-bottom: 12px;
}

.container .new-topic h4 {
    line-height: 1.6em;
    font-size: 1.2em;
    padding-left: 10px;
}


.container .question {
    width: 43em;
    height: 3em;
    color: #327a2a;
    border-radius: 5px;
    background-color: #f2f9dd;
    margin-top: 5px;
    padding-top: 5px;
    vertical-align: middle;
}



.container .question h4 {
    line-height: 2.3em;
    font-size: 1.1em;
    padding-left: 10px;
}

.questionaire textarea {
    width: 30em;
    margin: 10px 0;
    border-radius: 5px;
}

.questionaire button[name=delete-li] {
    background-color: transparent;
    text-decoration: none;
    color: red;
    float: right;
    vertical-align: middle;
}

.questionaire button:focus {
    text-decoration: none;
    outline: none;
}

.questionaire li {
    width: 42em;
    line-height: 2.4em;
    padding-left: 4em;
    background-color: #fdfdfd;
    border-bottom: 1px #ddd solid;
}

input:disabled {
    color: black;
}

.topic input:disabled {
    color: white !important;
    outline: none;
    border: 0;
    background-color: transparent;
}

.questionaire .topic input {
    width: 76% !important;
}

.questionaire input[name=option] {
    margin-top: 6px;
    padding: 0px 2px;
}



.questionaire select option:first-child {
    color: #999;
}

input[name=topic] {
    /*background: transpare。nt;*/
    /*margin-top: 2px;*/
    width: 65% !important;
    padding: 0px 2px;

}

.que input[type=text] {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #aaa;
}

.que {
    padding-left: 3px;
}

.edit input[type=text] {
    border: none;
    /*border-bottom:1px solid #000;*/
}

.edit input {
    background: transparent;
    border: none;
    outline: none;
}



.question li:first-child {
    width: 50%;
    /* background-color: red; */
}

.edit .add-option {
    display: none;
}

/*a {
            color: blue;
            text-decoration: underline;
        }*/

.question h4,
.question .num {
    display: inline-block;
}

.edit li button {
    display: none;
}

.fill {
    position: relative;
}


.questionaire .btns {
    position: absolute;
    right: 10px;
    top: 3px;
    /*left:0;*/
    /*background-color: red;*/
    /*width: auto;*/
    /*height: 400px;*/
}


.topic {
    position: relative;
}

.topic input {
    width: 80%;
    border-radius: 5px;
    padding: 3px;
}


.topic-btns {
    position: absolute;
    top: 0.5em;
    right: 4px;

}

.num {
    color: black;
}


.question .num,
.question input {
    display: inline-block;
    color: #327a2a;
    font-weight: 500;
}

.question .btns {
    width: 500px;
    height: 200px;
}



/*button[name=editok-que],
        button[name=add-que],
        button[name=delete-que],*/

button[name=edit-que] {
    /* margin-top: -7px; */
    height: 46px;
    width: 46px;
    border-radius: 50%;
    color: #fff;
    background-color: #327a2a;
    text-align: center;
    /*background-color: #4aaab3;*/
    /* margin:5px 10px; */
}


button[name=add-new-que],
button[name=add-que],
button[name=delete-que] {
    background-color: #ededed;
}

button[name=add-new-que] {
    color: blue;
}

button[name=add-que] {
    color: green;
}

button[name=delete-que] {
    color: red;
}

.que-edit {
    background-color: #f2f9dd;
    padding-left: 10px;
    width: 35em;
    border-radius: 5px;
}

.que-edit tr td:first-child,
.que-edit tr td:nth-child(2) {
    font-weight: 600;
    color: #327a2a;
    padding: 10px 5px;
    /*text-align: right;*/
}

.que-edit tr td:first-child {
    padding-left: 60px;
}

.que-search i {
    margin-right: 12px;
    font-size: 1.2em;
    padding: 8px;
    background-color: #f3f3f3;
    border-radius: 50%;
    cursor: pointer;
}

.que-necessary {
    background-color: red;
    color: white;
    font-weight: 600;
}

.question p {
    display: inline-block;
}
              
            
!

JS

              
                function drag() {

        const fills = document.querySelectorAll('.fill');
        const empties = document.querySelectorAll('.empty');
        const content = document.querySelector('.content');


        // Fill listeners

        fills.forEach(function (fill) {
            fill.addEventListener('dragstart', dragStart);
            fill.addEventListener('dragend', dragEnd);
        })


        // Loop through empty boxes and add listeners
        empties.forEach(function (empty) {
            empty.addEventListener('dragover', dragOver);
            empty.addEventListener('dragenter', dragEnter);
            empty.addEventListener('dragleave', dragLeave);
            empty.addEventListener('drop', dragDrop);
        })



        function dragStart(e) {


            const empties = document.querySelectorAll('.empty');
            empties.forEach(function (empty) {
                empty.remove();
            })




            if (this.parentElement.classList.contains("questionaire") === true) {


                const beforeFills = this.parentElement.querySelectorAll('.fill');
                const questionaires = this.parentElement;

                beforeFills.forEach(function (item) {
                    var newEmpty = document.createElement("div");
                    newEmpty.classList.add('empty');
                    item.parentElement.insertBefore(newEmpty, item.nextElementSibling);
                });

                var newEmpty = document.createElement("div");
                newEmpty.classList.add('empty');
                questionaires.prepend(newEmpty);

                if (this.nextElementSibling.classList.contains('empty') === true) {
                    this.nextElementSibling.remove();
                };
                if (this.previousElementSibling.classList.contains('empty') === true) {
                    this.previousElementSibling.remove();
                };

            } else {

                const beforeFills = document.querySelectorAll('.container .fill');
                const questionaires = document.querySelectorAll('.questionaire');

                beforeFills.forEach(function (item) {
                    var newEmpty = document.createElement("div");
                    newEmpty.classList.add('empty');
                    item.parentElement.insertBefore(newEmpty, item.nextElementSibling);
                });

                questionaires.forEach(function (item) {
                    var newEmpty = document.createElement("div");
                    newEmpty.classList.add('empty');
                    item.prepend(newEmpty);
                });

            }







            const newEmpties = document.querySelectorAll('.empty');

            newEmpties.forEach(function (empty) {
                empty.addEventListener('dragover', dragOver);
                empty.addEventListener('dragenter', dragEnter);
                empty.addEventListener('dragleave', dragLeave);
                empty.addEventListener('drop', dragDrop);
            })



            this.className += ' hold';


            var cloneContent = this.cloneNode(true);
            cloneContent.classList.remove('hold');
            content.append(cloneContent);



            if (this.parentElement.parentElement.classList.contains('container') == true) {
                setTimeout(() => (this.className = 'invisible'), 0);
            }


        }

        function dragEnd() {
            console.log('dragEnd');
            this.className = 'fill';

            const invisible = document.querySelectorAll('.invisible');

            invisible.forEach(function (item) {
                item.classList.remove('invisible');
            })

            content.innerHTML = "";

        }

        function dragOver(e) {
            e.preventDefault();
        }

        function dragEnter(e) {
            e.preventDefault();
            this.className += ' hovered';
        }

        function dragLeave() {
            this.className = 'empty';

        }

        function dragDrop() {



            content.firstElementChild.firstElementChild.classList.add('d-none');
            content.querySelector('.que').classList.remove('d-none');
            content.firstElementChild.lastElementChild.classList.remove('d-none');


            this.parentElement.insertBefore(content.firstElementChild, this);
            content.innerHTML = "";

            order();

            const empties = document.querySelectorAll('.empty');
            empties.forEach(function (empty) {
                empty.remove();
            })


            const invisible = document.querySelectorAll('.invisible');
            //console.log(invisible);
            invisible.forEach(function (item) {
                //item.classList.remove('invisible');
                item.remove();
            })

            drag();
        }

    };

    drag();



    var container = document.querySelector('.container');

    container.addEventListener('click', function (e) {

        //if (e.target.tagName.toLowerCase() === 'div') {
        //    console.log(e.target);
        //};

        if (e.target.tagName.toLowerCase() === 'button') {

            switch (e.target.name) {

                case "delete-que":

                    var topic = e.target.parentElement.parentElement.parentElement;
                    topic.remove();
                    order();

                    break;

                case "add-que":

                    var topic = e.target.parentElement.parentElement.parentElement;
                    var cloneTopic = topic.cloneNode(true);

                    topic.parentElement.insertBefore(cloneTopic, topic.nextElementSibling);
                    order();

                    break;


                case "add-new-que":

                    var topic = e.target.parentElement.parentElement.parentElement;

                    console.log(topic);
                    var cloneTopic = topic.cloneNode(true);

                    cloneTopic.querySelectorAll('button[name=delete-li]').forEach(function (item) {
                        item.parentElement.remove();
                    })

                    var option = cloneTopic.querySelector('#answerOptions option[value="0"]');
                    option.setAttribute("selected", "true");

                    cloneTopic.querySelector('.add-option').classList.add('d-none');

                    cloneTopic.querySelector('input[name=topic]').value = '';
                    cloneTopic.querySelector('input[name=topic]').placeholder = '請填題目';

                    if (cloneTopic.querySelector('button[name=necessary]').classList.contains('que-necessary')) {
                        cloneTopic.querySelector('button[name=necessary]').classList.remove('que-necessary');

                        if (cloneTopic.querySelector('.nec') != null) {
                            cloneTopic.querySelector('.nec').remove();
                        }


                    }

                    topic.parentElement.insertBefore(cloneTopic, topic.nextElementSibling);
                    order();

                    break;


                case "edit-que":

                    var topic = e.target.parentElement.parentElement;

                    topic.draggable ? (
                        topic.draggable = false
                    ) : (
                            topic.draggable = true
                        )

                    //topic.draggable == 'false';
                    //console.log(topic.draggable);


                    var que = e.target.parentElement.parentElement.querySelector('.que');

                    que.classList.contains('edit') ? (
                        que.classList.remove('edit')
                    ) : (
                            que.classList.add('edit')
                        )


                    topic.querySelectorAll('textarea,input,select').forEach(function (item) {
                        if (item.type !== 'button') {
                            item.disabled ? (
                                item.disabled = false
                            ) : (
                                    item.disabled = true
                                )
                        };
                    });

                    var select = topic.querySelector('#answerOptions');
                    select.classList.contains('d-none') ? (
                        select.classList.remove('d-none')
                    ) : (
                            select.classList.add('d-none')
                        )

                    if (e.target.classList.contains('fa-pencil-alt')) {
                        e.target.classList.remove('fa-pencil-alt');
                        e.target.classList.add('fa-check-circle');
                        e.target.style.backgroundColor = "#4aaab3";
                        e.target.title = "確定編輯";
                    } else {
                        e.target.classList.remove('fa-check-circle');
                        e.target.classList.add('fa-pencil-alt');
                        e.target.style.backgroundColor = "#327a2a";
                        e.target.title = "編輯";
                    };

                    break;

                case "delete-topic":

                    var allTopic = e.target.parentElement.parentElement;
                    var questionnaire = e.target.parentElement.parentElement.nextElementSibling;
                    allTopic.remove();
                    questionnaire.remove();

                    break;

                case "add-topic":

                    var allTopic = e.target.parentElement.parentElement;
                    var cloneAllTopic = allTopic.cloneNode(true);
                    var questionnaire = e.target.parentElement.parentElement.nextElementSibling;
                    var cloneQuestionnaire = questionnaire.cloneNode(true);

                    allTopic.parentElement.insertBefore(cloneQuestionnaire, questionnaire.nextElementSibling);
                    allTopic.parentElement.insertBefore(cloneAllTopic, questionnaire.nextElementSibling);
                    order();

                    break;

                case "edit-topic":

                    var topic = e.target.parentElement.parentElement;


                    topic.querySelectorAll('textarea,input,select').forEach(function (item) {
                        if (item.type !== 'button') {
                            item.disabled ? (
                                item.disabled = false
                            ) : (
                                    item.disabled = true
                                )
                        };
                    });

                    break;

                case "delete-li":

                    e.target.parentElement.remove();
                    break;

                case "necessary":

                    var que = e.target.parentElement.parentElement;

                    if (e.target.classList.contains('que-necessary')) {
                        e.target.classList.remove('que-necessary');

                        if (e.target.parentElement.querySelector('.nec') != null) {
                            e.target.parentElement.querySelector('.nec').remove();
                        }


                    } else {

                        e.target.classList.add('que-necessary');
                        var topic = e.target.parentElement.querySelector('input[name=topic]');
                        var n = "<p style='color:red' class='nec'>*<p>";
                        topic.insertAdjacentHTML("beforeBegin", n);

                        que.querySelectorAll('input[type=radio],input[type=checkbox]').forEach(function (item) {
                            item.setAttribute('required', 'required');
                            //必填功能
                            //不成功
                        })
                    }



                    break;
            }
        };


        if (e.target.tagName.toLowerCase() === 'a') {

            var cloneli = e.target.parentElement.previousElementSibling.cloneNode(true);
            cloneli.querySelector('input:last-child').value = "";
            cloneli.querySelector('input:last-child').placeholder = "請填選項";
            //console.log(cloneli);

            e.target.parentElement.parentElement.insertBefore(cloneli, e.target.parentElement);
        };



    }, false);





    function order() {

        const questionaires = document.querySelectorAll('.questionaire');

        questionaires.forEach(function (item) {
            const fill = item.querySelectorAll('.fill');

            for (i = 0; i < fill.length; i++) {
                var x = (i + 1) + ".";
                fill[i].querySelector('.question .num').innerText = x;
            }

        })

    }

    order();





    document.querySelectorAll('.questionaire .question').forEach(function (item) {
        var value = item.querySelector('#answerOptions').name;
        var option = item.querySelector('option[value="' + value + '"]');
        option.setAttribute("selected", "true");
        //console.log(option);
        //console.log(item.querySelector('option[name='+value+']'));

    })


    function optionChange(select) {
        var que = select.parentElement.parentElement;
        que.querySelectorAll('button[name=delete-li]').forEach(function (item) {
            item.parentElement.remove();
        })


        var addOption = que.querySelector('.add-option');
        switch (select.selectedIndex) {
            case 0:
                //addOption.parentElement.insertAdjacentHTML("beforeBegin", insertHTML);
                //if (!addOption.classList.contains('d-none')) {
                //    addOption.classList.add('d-none');
                //}


                break;

            case 1:
                var insertHTML = "<li><input type=radio id=newRadio disabled/><label for=newRadio> <input type=text placeholder=請填選項 /> </label><button name=delete-li title=刪除選項 class='btn far fa-times-circle'></button></li>"
                //addOption.parentElement.parentElement.innerHTML += insertHTML;

                addOption.parentElement.insertAdjacentHTML("beforeBegin", insertHTML);
                if (addOption.classList.contains('invisible')) {
                    addOption.classList.remove('invisible')
                }
                break;

            case 2:
                var insertHTML = "<li><input type=checkbox id=newCheckbox disabled/><label for=newCheckbox> <input type=text placeholder=請填選項 /> </label><button name=delete-li title=刪除選項 class='btn far fa-times-circle'></button></li>"
                //addOption.parentElement.parentElement.innerHTML += insertHTML;

                addOption.parentElement.insertAdjacentHTML("beforeBegin", insertHTML);
                if (addOption.classList.contains('invisible')) {
                    addOption.classList.remove('invisible');
                }
                break;
            case 3:
                var insertHTML = "<li><input type=text name=name /> <button name=delete-li class='btn far fa-times-circle d-none'></button></li>"
                //addOption.parentElement.parentElement.innerHTML += insertHTML;

                addOption.parentElement.insertAdjacentHTML("beforeBegin", insertHTML);
                if (!addOption.classList.contains('invisible')) {
                    addOption.classList.add('invisible');
                }

                break;
            case 4:
                var insertHTML = "<li><textarea rows=5></textarea><button name=delete-li class='btn far fa-times-circle d-none'></button></li>"
                //addOption.parentElement.parentElement.innerHTML += insertHTML;

                addOption.parentElement.insertAdjacentHTML("beforeBegin", insertHTML);
                if (!addOption.classList.contains('invisible')) {
                    addOption.classList.add('invisible');
                }
                break;
            default:
                break;
        }


    }

              
            
!
999px

Console