ググって知らべてみてもいまいちわからない点をお聞きしたいです。
・display: blok;はブロック要素をブロック要素に変えるのか
・もしそうだとしたら何の意味があるのか
インライン要素をブロック要素に変えて幅だとか高さだとかを指定できるようにするのはわかるんですけど、今僕のやっている教材はsectionタグ(ブロック要素)にこのプロパティを使っていた点が疑問に感じました。
自分でも果たしてこれが質問になっているのか少し疑問ですが、このプロパティにしっくり来てないので、何か助けになるような回答お願いいたします。
.topics{
padding: 120px;
}
.topics .content-wrapper{
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.topics .heading{
width: 35%;
}
.topics .content{
width: 65%;
}
.topics .content table{
width: 100%;
margin: 0 0 25% 0;
}
.topics .content th{
padding: 20px 2em 20px 0;
border-bottom: 1px dotted;/下線。の種類/
}
.topics .content td{
border-bottom: 1px dotted;
}
.topics .content tr:last-of-type th,
.topics .content tr:last-of-type td{
border-bottom: 1px dotted;
}
.topics .content .btn{/ボタン/
margin: 0;
}
.topics .content .btn a{
display: block;/これのおかげで幅、高さ、位置の指定ができる/
font-size: 0.8rem;
color: #000;
border: 1px solid #000;
text-align: center;
width: 200px;
line-height: 60px;
margin: 0 0 0 auto;
}
.topics .content .btn a:hover{/ホバーすると、、、のやつ/
background: #333;/ホバー背景変化/
color: #fff;/ホバー文字変化/
}
@media screen and (max-width:1199px){/1199px以下でおこる変化/
.topics{
padding: 50px 5vw;
}
.topics .content-wrapper{
display: block;/ブロック要素に変換//display: flex;をdisplay: block;で縦並びに戻している/
}
.topics .heading{
width: 100%;
}
.topics .heading h2{
text-align: center;
margin-bottom: 5vw;
}
.topics .content{
width: 100%;
}
}
@media screen and (max-width: 767px){/767px以内でおこる変化/
.topics{
padding: 50px 0;
width: 90%;
margin: 0 auto;
}
.topics .content .btn a{
width: 35%;
min-width: 200px;
margin: 0 auto;
}
}
@media screen and (max-width: 479px){/479px以内でおこる変化/
.topics .content th{
display: block;
width: 100%;
text-align: left;
padding: 1.25em 0 0 0;
border-bottom: 0;
}
.topics .content td{
display: block;
width: 100%;
}
}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/02/27 08:58 編集
2020/02/27 09:01 編集
2020/02/27 09:14
2020/02/27 09:39
2020/02/27 09:51