![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: Sep 2008
Posts: 13
|
I'd like to include some CSS that only webkit supports.
What's the best way of adding the CSS conditionally? Something like Code:
<!--[if webkit]> Any help appreciated, thanks. |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Only Internet Explorer has conditional comments.
Just use the -webkit- vendor prefix to the CSS properties. |
|
|
|
|
|
#3 |
|
WLC Member
Join Date: Sep 2008
Posts: 13
|
Thanks but I'm using
Code:
-webkit-background-clip: text; |
|
|
|
|
|
#4 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
????
Only browsers built with the webkit rendering engine support the -webkit- prefix. That's Safari and Chrome. |
|
|
|
|
|
#5 |
|
WLC Member
Join Date: Sep 2008
Posts: 13
|
Sorry, I should have posted the CSS to be more clear.
To give the text a gradient I'm giving the background a gradient and then using the text as a mask. If the browser doesn't support clipping to the text, I'll just use a single colour. It's the clipping to text that's only supported by webkit, so other browsers I guess show the background but don't clip to the text. It's not essential, just a nice to have and a learning experience. Code:
background-color: #c86476; background-image: -webkit-gradient(linear, left top, left bottom, from(#c86476), to(#b44b57)); background-image: -webkit-linear-gradient(top, #c86476, #b44b57); background-image: -moz-linear-gradient(top, #c86476, #b44b57); background-image: -o-linear-gradient(top, #c86476, #b44b57); background-image: -ms-linear-gradient(top, #c86476, #b44b57); background-image: linear-gradient(top, #c86476, #b44b57); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#c86476', EndColorStr='#b44b57'); background-clip: -webkit-background-clip: text; |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|