Pesquisar

Translate

CSS Fronteira (CSS Border)

CSS Fronteira (CSS Border) 


fonte e créditos:
w3schools




CSS Border


CSS Border Properties

The CSS border properties allow you to specify the style and color of an element's border.

Border Style

The border-style property specifies what kind of border to display.
Remark None of the border properties will have ANY effect unless the border-style property is set!

border-style values:

none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders. The width of the two borders are the same as the border-width value
groove: Defines a 3D grooved border. The effect depends on the border-color value
ridge: Defines a 3D ridged border. The effect depends on the border-color value
inset: Defines a 3D inset border. The effect depends on the border-color value
outset: Defines a 3D outset border. The effect depends on the border-color value
Try it yourself: Set the style of the border

Border Width

The border-width property is used to set the width of the border.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}

Try it yourself »


Border Color

The border-color property is used to set the color of the border. The color can be set by:
  • name - specify a color name, like "red"
  • RGB - specify a RGB value, like "rgb(255,0,0)"
  • Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}

Try it yourself »


Border - Individual sides

In CSS it is possible to specify different borders for different sides:

Example

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

Try it yourself »
The example above can also be set with a single property:

Example

border-style:dotted solid;

Try it yourself »
The border-style property can have from one to four values.
  • border-style:dotted solid double dashed;
    • top border is dotted
    • right border is solid
    • bottom border is double
    • left border is dashed
  • border-style:dotted solid double;
    • top border is dotted
    • right and left borders are solid
    • bottom border is double
  • border-style:dotted solid;
    • top and bottom borders are dotted
    • right and left borders are solid
  • border-style:dotted;
    • all four borders are dotted
The border-style property is used in the example above. However, it also works with border-width and border-color.

Border - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the border properties in one property. This is called a shorthand property.
The shorthand property for the border properties is "border":

Example

border:5px solid red;

Try it yourself »
When using the border property, the order of the values are:
  • border-width
  • border-style
  • border-color
It does not matter if one of the values above are missing (although, border-style is required), as long as the rest are in the specified order.

Examples

More Examples

All the top border properties in one declaration
This example demonstrates a shorthand property for setting all of the properties for the top border in one declaration.
Set the style of the bottom border
This example demonstrates how to set the style of the bottom border.
Set the width of the left border
This example demonstrates how to set the width of the left border.
Set the color of the four borders
This example demonstrates how to set the color of the four borders. It can have from one to four colors.
Set the color of the right border
This example demonstrates how to set the color of the right border.

All CSS Border Properties

PropertyDescription
borderSets all the border properties in one declaration
border-bottomSets all the bottom border properties in one declaration
border-bottom-colorSets the color of the bottom border
border-bottom-styleSets the style of the bottom border
border-bottom-widthSets the width of the bottom border
border-colorSets the color of the four borders
border-leftSets all the left border properties in one declaration
border-left-colorSets the color of the left border
border-left-styleSets the style of the left border
border-left-widthSets the width of the left border
border-rightSets all the right border properties in one declaration
border-right-colorSets the color of the right border
border-right-styleSets the style of the right border
border-right-widthSets the width of the right border
border-styleSets the style of the four borders
border-topSets all the top border properties in one declaration
border-top-colorSets the color of the top border
border-top-styleSets the style of the top border
border-top-widthSets the width of the top border
border-widthSets the width of the four borders



traduzido


CSS Fronteira


Propriedades CSS Fronteira

As propriedades de borda CSS permitem que você especifique o estilo ea cor da borda de um elemento.

Estilo da Borda

A propriedade border-style especifica que tipo de fronteira para exibir.
ObservaçãoNenhuma das propriedades de fronteira terá qualquer efeito a menos que o border-stylepropriedade é definida!

border-style valores:

none: nenhuma borda Define
pontilhada: Define uma borda pontilhada
tracejada: Define uma borda tracejada
sólido: Define uma borda sólida
duplo: Define duas fronteiras. A largura das duas bordas são o mesmo que o valor de largura de fronteira
Groove: Define uma borda 3D ranhuras. O efeito depende do valor borda de cor-
ridge: Define uma borda 3D ridged. O efeito depende do valor borda de cor-
inset: Define uma borda 3D embutida. O efeito depende do valor borda de cor-
início: Define uma borda 3D início. O efeito depende do valor borda de cor-
Tente você mesmo: Defina o estilo da borda

Largura da borda

A propriedade border-width é usada para definir a largura da borda.
A largura é definida em pixels, ou usando um dos três valores pré-definidos: finas, médio ou grosso.
Nota: O "border-width" propriedade não funciona se for usado sozinho. Use o "border-style" propriedade para definir as fronteiras primeiro.

Exemplo

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}

Tente você mesmo »


Cor da margem

A propriedade border-color é utilizado para definir a cor da borda. A cor pode ser definida por:
  • nome - especificar um nome de cor, como "vermelho"
  • RGB - especificar um valor RGB, como "rgb (255,0,0)"
  • Hex - especificar um valor hexadecimal, como "# ff0000"
Você também pode definir a cor da borda para "transparente".
Nota: O "border-color" propriedade não funciona se for usado sozinho. Use o "border-style" propriedade para definir as fronteiras primeiro.

Exemplo

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}

Tente você mesmo »


Border - lados individuais

Em CSS é possível especificar fronteiras diferentes para diferentes lados:

Exemplo

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

Tente você mesmo »
O exemplo acima também pode ser definido com uma única propriedade:

Exemplo

border-style:dotted solid;

Tente você mesmo »
A propriedade margem de estilo podem ter de um a quatro valores.
  • border-style: solid dupla pontilhada tracejada;
    • borda superior é pontilhada
    • margem direita é sólido
    • borda inferior é o dobro
    • borda esquerda é tracejada
  • border-style: double sólida pontilhada;
    • borda superior é pontilhada
    • bordas direita e esquerda são sólidos
    • borda inferior é o dobro
  • border-style: dotted sólidos;
    • bordas superior e inferior são pontilhados
    • bordas direita e esquerda são sólidos
  • border-style: dotted;
    • todas as quatro bordas são pontilhadas
A propriedade border-style é usado no exemplo acima. No entanto, ele também trabalha com border-width e border-color.

Border - propriedade Taquigrafia

Como você pode ver pelos exemplos acima, existem muitas propriedades a serem consideradas quando se trata de fronteiras.
Para diminuir o código, é também possível especificar todas as propriedades de fronteira, em uma propriedade. Isso é chamado de propriedade de taquigrafia.
O atalho para as propriedades de fronteira é "fronteira":

Exemplo

border:5px solid red;

Tente você mesmo »
Quando se utiliza a propriedade de fronteira, a ordem dos valores são:
  • border-width
  • border-style
  • border-color
Não importa se um dos valores acima estão ausentes (embora, borda estilo é necessária), enquanto o restante é na ordem especificada.

Exemplos

Exemplos

Todas as propriedades borda superior em uma declaração
Este exemplo demonstra uma propriedade atalho para definir todas as propriedades para a borda superior em uma declaração.
Definir o estilo da borda inferior
Este exemplo demonstra como definir o estilo da borda inferior.
Defina a largura da borda esquerda
Este exemplo demonstra como definir a largura da borda esquerda.
Defina a cor das quatro bordas
Este exemplo demonstra como definir a cor das quatro bordas. Pode ter de um a quatro cores.
Defina a cor da borda direita
Este exemplo demonstra como definir a cor da borda direita.

Todos os Border Propriedades CSS

PropriedadeDescrição
fronteiraDefine todas as propriedades de fronteira em uma declaração
border-bottomDefine todas as propriedades de borda inferior em uma declaração
border-bottom-colorDefine a cor da borda inferior
border-bottom-styleDefine o estilo da borda inferior
border-bottom-widthDefine a largura da borda inferior
border-colorDefine a cor das quatro bordas
margem esquerdaDefine todas as propriedades da borda esquerda em uma declaração
border-left-colorDefine a cor da borda esquerda
border-left-styleDefine o estilo da borda esquerda
border-left-widthDefine a largura da borda esquerda
margem direita,Define todas as propriedades da borda direita em uma declaração
border-right-colorDefine a cor da borda direita
border-right-styleDefine o estilo da borda direita
border-right-widthDefine a largura da borda direita
border-styleDefine o estilo das quatro bordas
borda superior-Define todas as propriedades da borda superior em uma declaração
border-top cor-Define a cor da borda superior
border-top-styleDefine o estilo da borda superior
border-top-widthDefine a largura da borda superior
border-widthDefine a largura das quatro bordas

fonte:


tags:
css, border, dicas, tutorial



|agregadordelinksmais|.|agregador de links|.|saúde|.|enviar links draft.blogger
adicionar |+Google URL| ...






 Bem-vindo (a)! Próximo Link  foi criado para que seja mostrado à você um novo conceito e uma nova visão do mundo... Ampliar os conhecimentos  ... "O objetivo principal é motivá-lo a ter confiança em si mesmo, a conseguir uma poderosa autoconfiança e segurança - com intuito de enfrentar com alegria este mundo e a viver vitoriosamente, bem-sucedido (a), sadio (a) e útil aos seus semelhantes!" Leia mais:  proximolink...

0 comentários:

Postar um comentário

Mensagem do formulário de comentário:

newer post Home

Formulário de contato

Nome

E-mail *

Mensagem *