CSS special pentru un browser
Last Updated: Feb 15 2011 00:15, Started by
Tavicu
, Feb 14 2011 20:14
·
0

#1
Posted 14 February 2011 - 20:14

Buna seara.
Lucrez la un design unde am dat de o mica problema. In cazul in care utilizatorul foloseste browserul Opera vreau sa includ opera.css Eu am facut prin aceasta metoda: Quote if(jQuery.browser.opera) { var toAdd = '<link rel="stylesheet" href="css/opera.css" type="text/css" />'; jQuery('head').append(toAdd); } Merge ok ... dar problema este ca w3 imi spune ca nu este valid. Cum rezolva? Mai jos avete head-ul din cod: Quote <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" media="all" href="style.css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/ie.css" /> <![endif]--> <script type='text/javascript' src='jquery.js'></script> <script type="text/javascript"> if(jQuery.browser.opera) { var toAdd = '<link rel="stylesheet" href="css/opera.css" type="text/css" />'; jQuery('head').append(toAdd); } </script> </head> |
#2
Posted 15 February 2011 - 00:15

<script type="text/javascript">
<![CDATA[ if(jQuery.browser.opera) { var toAdd = '<link rel="stylesheet" href="css/opera.css" type="text/css" />'; jQuery('head').append(toAdd); } ]]> </script> dar mai mult ca sigur ca problema nu e la opera ci la codul tau. opera afiseaza cel mai corect paginile web dintre toate browserele, in raport cu acele standarde w3... |
Anunturi
Bun venit pe Forumul Softpedia!
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users