freeCodeCamp/guide/portuguese/css/text/index.md

66 lines
2.3 KiB
Markdown

---
title: Text
localeTitle: Texto
---
## Texto
Várias propriedades são fornecidas pelo CSS para alterar a aparência do texto. Várias propriedades de texto são explicadas abaixo.
#### Cor do texto
\`\` \`html
Este é um exemplo de propriedade de texto CSS.
```
``` css
p {
color:red;
}
```
No exemplo acima, a `color` do texto do elemento `<p>` é alterada para vermelho. Você também pode especificar a cor como valores RGB, valores HLS e códigos hexadecimais (para obter mais informações sobre cores, clique [aqui](https://guide.freecodecamp.org/css/colors) ).
#### Alinhamento de texto
`text-align` propriedade `text-align` é usada para definir o alinhamento horizontal do texto. Pode levar valores à `left` , à `right` , ao `center` e `justify` . \`\` \`css p { texto-alinhar: centro; }
```
Here the text is aligned to the `center` ([example](https://www.w3schools.com/css/tryit.asp?filename=trycss_text-align)).When `text-align` is set to `justify`,each line is stretched so that every line has equal width, and the left and right margins are straight ([example](https://www.w3schools.com/css/tryit.asp?filename=trycss_text-align_all)).
#### Text Decoration
```
css p { text-decoration: sublinhado; }
```
The `text-decoration` property is used to set or remove decorations from text. The value `text-decoration: none;` is often used to remove underlines from links. Other `text-decorations` include `overline`,`line-through`,and `underline` ([example](https://www.w3schools.com/css/tryit.asp?filename=trycss_text-decoration)).
#### Text Tranformation
```
css p { text-transform: capitalize; }
```
The `text-transform` property is used to convert the entire text to `uppercase`,`lowercase` or to `capitilize` each word([example](https://www.w3schools.com/css/tryit.asp?filename=trycss_text-transform)).
#### Letter Spacing
The `letter-spacing` property sets the space between characters in a text.
```
css p { espaçamento entre letras: 5px; }
```
#### Line Height
The `line-height` property sets the space between two lines of text.
```
css p { Altura da linha: 5 px; }
```
#### Word Spacing
The `word-spacing` sets the space between words in a text.
```
css p { espaçamento entre palavras: 5px; } \`\` \`
#### Mais Informações:
[Texto CSS do W3Schools](https://w3schools.com/css/css_text.asp)