CENTRAL DO CLIENTE   
(usehost) Base de Conhecimentos

Home | Sumário | Favoritos | Contato | Efetuar Login Home | Sumário | Favoritos | Contato | Efetuar Login
Pesquisar na base de dados Pesquisar por categoria
Transparência em WebDesign
Detalhes do artigo

Última atualização
11th o June, 2010

Opções de usuário (2 votos)
100% thumbs up 0% thumbs down

Como você avaliaria este artigo?
Útil
Inútil
Transparency in Web Design
Posted on: 6/6/2010   By: Chris Coyier 52 Comments

How is it done? Let’s take a gander at four different ways. Each of them handling the illusion in a different way, and each completely appropriate depending on the situation at hand.

Totally Friggin Fake It


From the Spectrum Theme website

The end result of any web design is basically an illusion anyway. You can always create your transparent effects in Photoshop or whatever other graphics editor and export flat graphics. In Photoshop, transparent effects can be created by changing a layers opacity level, fill level, or blending mode, just to name a few.

Opacity


This entire button has opacity applied to it, to emphasize that it is currently “disabled”.

You can make any element transparent by using the opacity parameter of CSS.

#anything {
opacity: 0.5; /* 50% transparent */
}

If you need to support older browsers, see here.

Do note that all descendants of the element with opacity also become transparent. There is no way to “force” any descendant to be come any less transparent as the parent is.

RGBa / HSLa


From the Like Architects site

Using RGBa for a color value in CSS, you can set a transparency level on any color. This has the distinct advantage over opacity in that it doesn’t have any affect on descendants. It is also nice in that creating faded out variations of a color is as easy as changing the final alpha value. Speaking of color variations, that is even easier to do with HSLa, and is still able to handle transparency.

#anything {
background: rgba(0,0,0,0.5); /* 50% transparent */
}
#anything {
background: hsla(0,0,0,0.5); /* 50% transparent */
}

PNG


From a Dribbble

When “Saving for web” from Photoshop, you have two choices for PNG’s: PNG-8 and PNG-24. PNG-8 is like a GIF in that you can have transparency in pixels, but a pixel is either fully transparent or fully opaque, no in-between. PNG-24’s, while far bigger in file size, support full alpha-transparency.

In the example above, the shadows from the content areas are from PNG-24s so that the texture in the background can change and the shadows will still be the same.

Comentários
Não hpa comentários de visitantes. Comentar
Postou comentário para o artigo "Transparência em WebDesign"
Para postar um comentário para este artigo, preencha o formulário a seguir. campos marcados com asterisco são obrigatórios.
   Seu nome:
   Endereço de e-mail:
* Comentário:
* Digite o código a seguir::
 
Artigos relacionados
Não foi encontrado artigos relacionados.
Anexos
Nenhum anexo.

Continuar

Pagamento de Faturas
2ª Via do Boleto Bancário
Digite o N° da Cobrança:

 

Se seu pagamento não for por
boleto bancário, acesse a nossa
Central do Cliente. E proceda o pagamento.

UMA EMPRESA DO GRUPO INTECORP TECNOLOGIA®
(C) Copyright 2004-2010 (usehost) Serviços de Internet do Brasil.
Compartilhe: