2.4 KiB
2.4 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7791367417b2b2512ab3 | Create Visual Balance Using the text-align Property | 0 | 使用text-align属性创建视觉平衡 |
Description
text-align
属性text-align
。 text-align: justify;
导致除最后一行之外的所有文本行都与行框的左右边缘相交。 text-align: center;
文本text-align: right;
右对齐文本和text-align: left;
(默认值)左对齐文本。 Instructions
h4
标签的文本(称为“Google”)与中心对齐。然后证明段落标记是合理的,其中包含有关Google如何成立的信息。 Tests
tests:
- text: 您的代码应使用<code>h4</code>标记上的text-align属性将其设置为居中。
testString: 'assert($("h4").css("text-align") == "center", "Your code should use the text-align property on the <code>h4</code> tag to set it to center.");'
- text: 您的代码应使用<code>p</code>标记上的text-align属性将其设置为对齐。
testString: 'assert($("p").css("text-align") == "justify", "Your code should use the text-align property on the <code>p</code> tag to set it to justify.");'
Challenge Seed
<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>
Solution
// solution required