Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Question about style sheetsQuestion about style sheets
Previous
 
Next
New Post
8/1/2008 9:45 PM
 

I am moving a large .net application to DotNetNuke. Currently I have 2 style sheets. One is for firefox/IE6 and the second is for IE7. On aspx pages, I use:

<link href="styles.css"           rel="stylesheet" type="text/css" />
<!--[if gte IE 7]>  
<link href="stylesIE7.css"     rel="stylesheet" type="text/css" />
<![endif]-->

to differentiate between the two.

Within the firefox/IE6 style sheet, I use this:

html>body .helpticketselect {  vs.  .helpticketselect {

to differentiate between firefox and IE6.

So here is my question. I know that I should *not* link to stylesheets from within a control (ascx) and I want to put all my style information into module.css, I can just cut/paste the firefox/IE6 code but how do I integrate the IE7 style sheet?

thanks

Nick

 

 

 

 
New Post
8/2/2008 10:53 AM
Accepted Answer 

Hi Nick,

I found this very simple js script that i put in all my skins that help me with the different browser issues.  This is not my script, and i don't remember where i found it, but it works great.

<script type="text/javascript">
var css_browser_selector = function() {var ua=navigator.userAgent.toLowerCase(),is=function(t){return ua.indexOf(t) != -1;},h=document.getElementsByTagName('html')[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js'; h.className += h.className?' '+c:c;}();
/*
Examples:

html.gecko div#header { margin: 1em; }
.opera #header { margin: 1.2em; }
.ie .mylink { font-weight: bold; }
.mac.ie .mylink { font-weight: bold; }
.[os].[browser] .mylink { font-weight: bold; } -> without space between .[os] and .[browser]
Available OS Codes [os]:
win - Microsoft Windows
linux - Linux (x11 and linux)
mac - Mac OS
Available Browser Codes [browser]:
ie - Internet Explorer (All versions)
ie8 - Internet Explorer 8.x
ie7 - Internet Explorer 7.x
ie6 - Internet Explorer 6.x
ie5 - Internet Explorer 5.x
gecko - Mozilla, Firefox (all versions), Camino
ff2 - Firefox 2
ff3 - Firefox 3
opera - Opera (All versions)
opera8 - Opera 8.x
opera9 - Opera 9.x
konqueror - Konqueror
webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira */
</script>

 
New Post
8/3/2008 12:21 AM
 

Thanks Andrew, that is really excellent. I did find the original website:

http://rafael.adm.br/css_browser_selector/

Nick

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Question about style sheetsQuestion about style sheets


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out