CSS 화면 어둡게 오버레이

1 개요[ | ]

CSS 화면 어둡게 오버레이
<style>
html {
  height: 150%;
  background: linear-gradient(red, yellow, green);
}

.overlay {
  display: none;
  z-index: 1000;
  position: fixed;
  width: 100%; height: 100%;
  left: 0; top: 0;
  background-color: rgba(0,0,0, 0.4);
  overflow-x: hidden;
}
</style>

<div class="overlay"></div>
<button id="btn-dark">어둡게</button>

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$(function() {
  $("#btn-dark").click(function() {
    $(".overlay").show();
  });
});
</script>

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}