www.webdeveloper.com
Results 1 to 2 of 2

Thread: If opera

  1. #1
    Join Date
    Oct 2010
    Posts
    13

    If opera

    Hi i have a small problem ... when i have in my normal .css file to example:
    body { background-color: black; }
    and i want have to example red background only in OPERA how i can do it?

    something like ...

    <!--[if Opera]>
    <link rel="stylesheet" type="text/css" href="opera.css" />
    <![endif]-->

    and there i can body { backgrond-color: red; }

    because that do nothing

    Please help thx

  2. #2
    Join Date
    Nov 2010
    Location
    Los Angeles, CA
    Posts
    234
    Those conditional comments are for internet exploder only. Don't use hacks inside your CSS either. The best way to use separate stylesheets for different browsers is to detect the user agent via the HTTP headers. It's best done on the back end. If your server side scripts detect a particular browser, then either a particular external stylesheet is included or a few lines of CSS is placed into the head. This can also be done with javascript.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles