Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS 표시의 차이점:없음; 가시성:숨김;

<시간/>

CSS 표시:없음;

display:none 속성은 요소를 삭제하지 않고 숨기는 데 사용됩니다. 공간을 차지하지 않습니다.

<!DOCTYPE html>
<html>
   <head>
      <style>
         h3 {
            display: none;
         }
      </style>
   </head>
   <body>
      <h2>This heading is visible</h2>
      <h3>This is a hidden heading</h3>
      <p>The hidden heading does not take up space even after hiding it since we have used display: none;.</p>
   </body>
</html>

CSS 가시성:숨김,

가시성:숨겨진 속성은 또한 요소를 숨기지만 레이아웃에 영향을 줍니다. 즉, 공간을 차지합니다. 예를 살펴보겠습니다.

<!DOCTYPE html>
<html>
   <head>
      <style>
         h3 {
            visibility: hidden;
         }
      </style>
   </head>
   <body>
      <h2>This heading is visible</h2>
      <h3>This is a hidden heading</h3>
      <p>The hidden heading takes up space even after hiding it.</p>
   </body>
</html>