Skip to content

Instantly share code, notes, and snippets.

@okumurakengo
Last active November 17, 2020 04:10
Show Gist options
  • Save okumurakengo/9e583f0ae66ebdd5668325c6c2eaa834 to your computer and use it in GitHub Desktop.
Save okumurakengo/9e583f0ae66ebdd5668325c6c2eaa834 to your computer and use it in GitHub Desktop.
簡易モーダルを表示するスクリプト、devtoolsのコンソールにコピペしたら簡易モーダルが表示される
document.body.style.position = 'relative'
document.body.insertAdjacentHTML('beforeend', `
<div class="user_css_container">
<div class="user_css_box">
<h1>簡易モーダル</1>
</div>
</div>
<style>
.user_css_container {
box-sizing: border-box;
width: 100%;
height: 100vh;
position: absolute;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
background: transparent;
}
.user_css_box {
background-color: lightgreen;
width: 300px;
height: 200px;
}
</style>
`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment