Apply different CSS codes to different browsers

Source: Internet
Author: User
Q:

I want to write some CSS that works only in IE6 without putting it in a separate file like the following:

 
<! -- [If IE 6]>
<LINK rel = "stylesheet" type = "text/CSS" href = "iespecific.css"/>
<! [Endif] -->

Is this possible?

Also if some one know any articles about how to make a scrolling news links without having problems in hovering as I have for example: news1 .. news2 .. news3 also the dots shouldn't be clickable like the links as mine too. please lead me to it.

A:

For more information about conditional comments, check the following link please:
 
CSS-conditional comments
Http://www.quirksmode.org/css/condcom.html
 
Otherwise, there is another way to apply CSS by browser type and Resolution Ratio Via javascript:
Code from http://blog.csdn.net/xiaozhao_19/archive/2008/03/25/2216414.aspx

 

< Script Language = "JavaScript" >  
<! --  
If (Window. Navigator. useragent. indexof ( " MSIE " ) > = 1 )
{
//IE
Setactivestylesheet ("Default.css");
} Else {
If (Window. Navigator. useragent. indexof ( " Firefox " ) > = 1 )
{
//Firefox
Setactivestylesheet ("Default2.css");
} Else {
//Other
Setactivestylesheet ("Newsky.css");
}  
}  

Function Setactivestylesheet (title) {< br> document. getelementsbytagname ( " link " ) [ 0 ]. href = " style/ " + title;
}  
// -->
</ Script >

 
 
To make scrollingNews Links, I think you can use a <marqueue> just like the following code:

 < Marquee  Behavior  = Scroll  Direction  = Left  Width  = 100%  Height  = 115  Scrollamount  = 1  Scrolldelay  = 70  Onmouseover  = 'This. Stop ()'  Onmouseout = 'This. Start ()'  >  
< A Href = "Http://forums.asp.net" > Your links </ A >
< A Href = "Http://forums.asp.net" > Your links </ A >
< A Href = "Http://forums.asp.net" > Your links </ A >
< A Href = "Http://forums.asp.net" > Your links </ A >
< A Href = "Http://forums.asp.net" > Your links </ A >
</ Marguee >


If I 've misunderstood your problem, please feel free to let me know.

Thanks.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.