120 lines
3.0 KiB
Markdown
120 lines
3.0 KiB
Markdown
![]() |
---
|
||
|
id: 587d781b367417b2b2512abd
|
||
|
title: 段落要素と対比して見出し要素のサイズを調整する
|
||
|
challengeType: 0
|
||
|
videoUrl: 'https://scrimba.com/c/c3bRPTz'
|
||
|
forumTopicId: 301037
|
||
|
dashedName: adjust-the-size-of-a-heading-element-versus-a-paragraph-element
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
見出し要素 (`h1` から `h6`) のフォントサイズは、通常は段落タグのフォントサイズより大きくなるべきです。 そうすることにより、ページ上のあらゆる物のレイアウトと重要度がユーザーにとって視覚的に理解しやすくなります。 要素内のテキストのサイズを調整するには `font-size` プロパティを使用します。
|
||
|
|
||
|
# --instructions--
|
||
|
|
||
|
見出しを段落よりも大幅に大きくするために、`h4` 要素の `font-size` を 27 ピクセルに変更してください。
|
||
|
|
||
|
# --hints--
|
||
|
|
||
|
`h4` 要素に、27 ピクセルに設定した `font-size` プロパティを追加してください。
|
||
|
|
||
|
```js
|
||
|
assert($('h4').css('font-size') == '27px');
|
||
|
```
|
||
|
|
||
|
# --seed--
|
||
|
|
||
|
## --seed-contents--
|
||
|
|
||
|
```html
|
||
|
<style>
|
||
|
h4 {
|
||
|
text-align: center;
|
||
|
background-color: rgba(45, 45, 45, 0.1);
|
||
|
padding: 10px;
|
||
|
|
||
|
}
|
||
|
p {
|
||
|
text-align: justify;
|
||
|
}
|
||
|
.links {
|
||
|
text-align: left;
|
||
|
color: black;
|
||
|
}
|
||
|
.fullCard {
|
||
|
width: 245px;
|
||
|
border: 1px solid #ccc;
|
||
|
border-radius: 5px;
|
||
|
margin: 10px 5px;
|
||
|
padding: 4px;
|
||
|
}
|
||
|
.cardContent {
|
||
|
padding: 10px;
|
||
|
}
|
||
|
.cardText {
|
||
|
margin-bottom: 30px;
|
||
|
}
|
||
|
</style>
|
||
|
<div class="fullCard">
|
||
|
<div class="cardContent">
|
||
|
<div class="cardText">
|
||
|
<h4>Alphabet</h4>
|
||
|
<hr>
|
||
|
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
|
||
|
</div>
|
||
|
<div class="cardLinks">
|
||
|
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
|
||
|
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
```
|
||
|
|
||
|
# --solutions--
|
||
|
|
||
|
```html
|
||
|
<style>
|
||
|
h4 {
|
||
|
text-align: center;
|
||
|
background-color: rgba(45, 45, 45, 0.1);
|
||
|
padding: 10px;
|
||
|
font-size: 27px;
|
||
|
}
|
||
|
p {
|
||
|
text-align: justify;
|
||
|
}
|
||
|
.links {
|
||
|
text-align: left;
|
||
|
color: black;
|
||
|
}
|
||
|
.fullCard {
|
||
|
width: 245px;
|
||
|
border: 1px solid #ccc;
|
||
|
border-radius: 5px;
|
||
|
margin: 10px 5px;
|
||
|
padding: 4px;
|
||
|
}
|
||
|
.cardContent {
|
||
|
padding: 10px;
|
||
|
}
|
||
|
.cardText {
|
||
|
margin-bottom: 30px;
|
||
|
}
|
||
|
</style>
|
||
|
<div class="fullCard">
|
||
|
<div class="cardContent">
|
||
|
<div class="cardText">
|
||
|
<h4>Alphabet</h4>
|
||
|
<hr>
|
||
|
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
|
||
|
</div>
|
||
|
<div class="cardLinks">
|
||
|
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
|
||
|
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
```
|
||
|
|