![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VB.NET: dynamic css Hi, I have a web project in VB.NET 2005. I want to detect the user's web browser and version, then make a change to the CSS based on which version of IE, 6 or 7. I have a javascript function pageLoad that works to detect the version but I'm still trying to get the css changed from that point. Does anybody here know how to do this? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: VB.NET: dynamic css VB.NET is inconsequential here, as you are doing this in JavaScript. Your stylesheet probably looks something like this: <link id="cssFile" href="ie.css" type="text/css" rel="stylesheet"> You then have a test that says it is Firefox, not IE. Just do this: document.getElementById('cssFile').href = 'firefox.css'; I typed this in freehand, so fix it if necessary. The basic concept works. -- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA Blog: http://feeds.feedburner.com/GregoryBeamer ********************************************* | Think outside the box | ********************************************* "Mike J." <MikeJ@xxxxxx> wrote in message news:0F6EB95D-DA65-4B45-8593-2430AE317190@xxxxxx Quote: > Hi, I have a web project in VB.NET 2005. I want to detect the user's web > browser and version, then make a change to the CSS based on which version > of > IE, 6 or 7. I have a javascript function pageLoad that works to detect > the > version but I'm still trying to get the css changed from that point. Does > anybody here know how to do this? |
My System Specs![]() |
| | #3 (permalink) |
| | Re: VB.NET: dynamic css Mike J. wrote: Quote: > Hi, I have a web project in VB.NET 2005. I want to detect the user's > web browser and version, then make a change to the CSS based on which > version of IE, 6 or 7. I have a javascript function pageLoad that > works to detect the version but I'm still trying to get the css > changed from that point. Does anybody here know how to do this? fiddly CSS hacks: http://www.quirksmode.org/css/condcom.html So if the user has Opera set to pretend to be IE in the user-agent string, it still works. Andrew |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Dynamic statements? | PowerShell | |||
| Dynamic Backgrounds gone | Live Messenger | |||
| Dynamic .vhd expansion. | Virtual Server | |||
| dynamic disks | Vista hardware & devices | |||