|
|
||||||||||||||
|
|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
|
||||||
![]() |
|
![]() |
|
|||||||||||
![]() |
![]() |
![]() |
|
|||||||||||
|
|
|
|||||||||||||
|
|
|
|||||||||||||
|
|
|
|||||||||||||
|
|
Comentarile ConditionaleFunctioneaza doar in Internet Explorer pe Windows, si sunt facute in asa fel sa dea niste instructiuni speciale doar Internetului Explorerpe Windows. Sunt suportate incepand cu Internet Explorer 5 si e posibil sa le diferentiem intre versiunile 5.0, 5.5 si 6.0. Comentariile conditionale sunt folosite in modul urmator: <!--[if IE 6]>
Instructiuni speciale pentru IE 6 aici
<![endif]-->
ExempleMai jos am adaugat niste comentari conditionale care afiseaza mesaje in functie de versiunea de internet explorer. Nota oricum, daca folositi multiple Explorers pe un PC, comentarile conditionale vor functiona ca si cum aceste versiuni de IE sunt cele mai mari versiuni disponibile pe masina d-voastra.(de obicei IExplorer 6.0). TestMai jos sunt cateva comentari conditionale care arata ce versiune de Internet Explorer folosesti. Daca nu vezi niciuna inseamna ca nu folosesti Internet Explorer.
CodeSyntaxa pe care am folosit-o e: <p><!--[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]-->
<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->
<!--[if IE 5.0]>
According to the conditional comment this is Internet Explorer 5.0<br />
<![endif]-->
<!--[if IE 5.5]>
According to the conditional comment this is Internet Explorer 5.5<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is Internet Explorer 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is Internet Explorer 7<br />
<![endif]-->
<!--[if gte IE 5]>
According to the conditional comment this is Internet Explorer 5 and up<br />
<![endif]-->
<!--[if lt IE 6]>
According to the conditional comment this is Internet Explorer lower than 6<br />
<![endif]-->
<!--[if lte IE 5.5]>
According to the conditional comment this is Internet Explorer lower or equal to 5.5<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is Internet Explorer greater than 6<br />
<![endif]-->
</p>
Atentie la syntaxa speciala:
CSS hack?Pot fi aceste comentari conditionale definite ca un CSS hacks? Teoretic da de vreme ce ele servesc in oferirea unui unor styluri speciale unor browsere. Oricum nu se bazeaza pe bug-ul uni browser ca sa rezolve un alt bug cum majoritatea adevaratelor CSS hacks fac. In afara de asta acestea pot fi folosite mai mult decat ca un CSS hacks (chiar daca se intampla destul de rar). De vreme ce Comentarile conditionale nu sunt bazate pe un browser hack ci sunt facute special pentru a ne ajuta cred ca sunt sigure de folosit. Desigur alte browsere pot implementa comentarile conditionale , (desi niciunul nu a facut-o pana acum), dar nu cred ca vor reactiona la interogari de genul Folosesc comentarile conditionale destul de rar . Intai vad daca pot gasi o reala solutie CSS pentru o problema a Iexplore.Daca nu reusesc in schimb nu exit sa le folosesc. Comment tagUn cititor mi-a spus ca Explorer (Windows and Mac) suporta (non-standard) <p>This is <comment>not</comment> Internet Explorer.</p>
This is
Acest tag poate fi foarte util daca doriti sa folositi un stil pentru non Explorer browsers. Din pacate aceste cazuri sunt rare de cand ambele IExplore pe Windows sau MAC suporta acest tag si de obicei incearca sa ofere un continut special sau stil numai unuia dintre ele.
|
|
|
|||||||||||
|
|
|
|||||||||||||
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|