2021-06-15 16:21:20 +02:00
---
id: 587d7791367417b2b2512ab3
2021-07-05 12:27:02 +05:30
title: Criar equilíbrio visual usando a propriedade text-align
2021-06-15 16:21:20 +02:00
challengeType: 0
videoUrl: 'https://scrimba.com/c/c3b4EAp'
forumTopicId: 301053
dashedName: create-visual-balance-using-the-text-align-property
---
# --description--
2021-07-05 12:27:02 +05:30
Esta seção do currículo se concentra no Design Visual Aplicado. O primeiro grupo de desafios baseia-se no layout de cartão fornecido para mostrar uma série de princípios básicos.
2021-06-15 16:21:20 +02:00
2021-07-05 12:27:02 +05:30
O texto costuma ser uma grande parte do conteúdo na web. O CSS possui várias opções de como alinhá-lo com a propriedade `text-align` .
2021-06-15 16:21:20 +02:00
2021-10-27 15:10:57 +00:00
`text-align: justify;` espaça o texto para que cada linha tenha a mesma largura.
2021-06-15 16:21:20 +02:00
2021-07-05 12:27:02 +05:30
`text-align: center;` centraliza o texto
2021-06-15 16:21:20 +02:00
2021-07-05 12:27:02 +05:30
`text-align: right;` alinha o texto à direita
2021-06-15 16:21:20 +02:00
2021-07-05 12:27:02 +05:30
E `text-align: left;` (o padrão) alinha o texto à esquerda.
2021-06-15 16:21:20 +02:00
# --instructions--
2021-07-05 12:27:02 +05:30
Alinhe o texto da tag `h4` , que diz "Google", ao centro. Em seguida, justifique (justify) a tag de parágrafo que contém informações sobre como o Google foi fundado.
2021-06-15 16:21:20 +02:00
# --hints--
2021-07-05 12:27:02 +05:30
Você deve usar a propriedade text-align com o valor de `center` na tag `h4` .
2021-06-15 16:21:20 +02:00
```js
assert($('h4').css('text-align') == 'center');
```
2021-07-05 12:27:02 +05:30
Você deve usar a propriedade text-align com o valor de `justify` na tag `p` .
2021-06-15 16:21:20 +02:00
```js
assert($('p').css('text-align') == 'justify');
```
# --seed--
## --seed-contents--
```html
< 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--
```html
< 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 >
```