01.CSSベース-ブロックレベル&インラインレベル
🌈 block-level & inline-level
🔥 block-level&inline-levelとは何ですか?
🔥 属性の表示
🔥 可視性プロパティ
🔥 inline-blockプロパティ
1.block-level&inline-levelは?
1)block-levelの特性
2)inline levelの特性
✍🏻 html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<style>
.spantag {
background-color: tomato;
}
.divtag {
background-color: aquamarine;
}
</style>
</head>
<body>
<h2>div 태그 속에 span 태그</h2>
<div class="spantag">
이것 부분은 div 태그로 묶인 한 문장입니다.
<span>"이 부분은만 span 태그로 감싸져 있습니다."</span> span은 inline-block 요소이기 때문에 줄 바꿈이 되지
않습니다.
</div>
<h2>span 태그 속에 div 태그</h2>
<span class="divtag">
이것 부분은 span 태그로 묶인 문장입니다.
<div>"이 부분만 div태그로 감싸져 있습니다."</div>
div는 block-level 요소이기 때문에 모든 영역을 차지하여 줄바꿈이 됩니다.
</span>
</body>
</html>
2.属性の表示
3.可視性プロパティ
✍🏻 html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<style>
body {
display: flex;
}
div {
width: 300px;
}
span {
background-color: tomato;
}
strong {
background-color: aquamarine;
}
.display_none {
display: none;
}
.visibility_hidden {
visibility: hidden;
}
</style>
</head>
<body>
<div>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
<strong>Can you see me? Can you see me? Can you see me? Can you see me?</strong>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
</div>
<div>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
<strong class="display_none">Can you see me? Can you see me? Can you see me? Can you see me?</strong>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
</div>
<div>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
<strong class="visibility_hidden">Can you see me? Can you see me? Can you see me? Can you see me?</strong>
<span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt facere iusto provident corporis? Nulla, exrerum voluptatem fuga rem saepe, quis, voluptatibus nihil consequuntur tempore repellat accusantium ab? Totam,tempora.</span>
</div>
</body>
</html>
4.inline block特性
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
margin: 20px;
}
div {
display: inline-block;
width: 300px;
height: 300px;
background-color: teal;
margin-right: 10.01;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>
Reference
この問題について(01.CSSベース-ブロックレベル&インラインレベル), 我々は、より多くの情報をここで見つけました https://velog.io/@jewon119/01.CSS-기초-block-level-inline-levelテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol