Files
freeCodeCamp/curriculum/challenges/japanese/01-responsive-web-design/applied-visual-design/create-visual-balance-using-the-text-align-property.md
2022-01-20 20:30:18 +01:00

3.2 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
587d7791367417b2b2512ab3 text-align プロパティで見た目のバランスを作成する 0 https://scrimba.com/c/c3b4EAp 301053 create-visual-balance-using-the-text-align-property

--description--

本カリキュラムのこのセクションでは、ビジュアルデザインの応用に焦点を当てます。 最初のいくつかのチャレンジでは、例として与えられたカードのレイアウトを見ながらいくつかの原則を説明します。

テキストは多くの場合、ウェブコンテンツの大部分を占めます。 CSS には、テキストをどのように整列させるかによって text-align プロパティにいくつかのオプションがあります。

text-align: justify; は、各行が等しい幅になるようにテキストの語間を開けます。

text-align: center; は、テキストを中央揃えにします。

text-align: right; は、テキストを右揃えにします。

そして text-align: left; (デフォルト) は、テキストを左揃えにします。

--instructions--

h4 タグのテキスト "Google" を中央揃えにしてください。 次に、Google の設立についての情報が書かれた段落タグを両端揃え (justify) にしてください。

--hints--

h4 タグの text-align プロパティを使用し、center に設定してください。

assert($('h4').css('text-align') == 'center');

p タグの text-align プロパティを使用し、justify に設定してください。

assert($('p').css('text-align') == 'justify');

--seed--

--seed-contents--

<style>
  h4 {

  }
  p {

  }
  .links {
    margin-right: 20px;

  }
  .fullCard {
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>

--solutions--

<style>
  h4 {
    text-align: center;
  }
  p {
    text-align: justify;
  }
  .links {
    margin-right: 20px;

  }
  .fullCard {
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>