How to do a Chrome/Opera specific stylesheet?

前端 未结 6 657
野性不改
野性不改 2020-12-07 23:26

I need to do chrome/opera hacks because of a font replacement script wanted by the client that breaks things... this is sad but everything is working in IE6

6条回答
  •  我在风中等你
    2020-12-07 23:54

    for Google (and Safari) you can simply use the following;

    
    

    this will load a webkit specific style-sheet. The 'type' can be named whatever you want but has to be included.

    You just go ahead and create your stylesheet as you please and all non-webkit browsers will simply ignore it.

    You'll have to use the hacks above for the Opera. The following worked best for me:

    @media not screen and (1)
        {
        #example
        {
        width: 200px;
        }
    }
    

    I've used it to load browser-specific @font-face declarations.

提交回复
热议问题