3 Replies - 482 Views - Last Post: 24 January 2013 - 10:22 AM

#1 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 339
  • Joined: 10-November 09

HTML/CSS in a .NET markup with issues

Posted 24 January 2013 - 09:37 AM

Normally, I'm good with HTML/CSS - but this is has me stumped.

I was handed this project by someone who couldn't complete it - in order to move onto another project. I have this age verification landing page that a user hits before entering a site. There is this line of CSS/Code that makes no sense to me, but it almost works.

    @-moz-document url-prefix()
    {
        <link href="_CSS/Firefox.css" rel="stylesheet" type="text/css" />
    }



What happens is, I get a gap in the top of the page (about 10-12px tall). It doesn't look like anything is there, but if you highlight from left to right, the first line "@-moz-document url-prefix()" shows up. (I've attached screen shots)

If I remove it, Firefox's css just blows up. I've tried to do a Javascript browser detection, like this:
<script type="text/javascript">
     var browser = navigator.userAgent;
     if (browser == "Firefox") {
         document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"_CSS/Firefox.css\">");
     } else if (browser == "Microsoft Internet Explorer") {
         document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"_CSS/IE.css\">");
     } else {
         document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"_CSS/AgeVerify.css\">");
     }
</script>



But this doesn't work... the only thing that DOES work (sort of) is the "@-moz-document url-prefix()" line.

1) What IS that?
2) Is there a way to get that to NOT show up in the page and remove the gap?
3) Maybe it wasn't utilized correctly to begin with?

Any thoughts and suggestions would be VERY helpful.

Here are my screen shots showing the gap, and the highlighted text.
Posted Image
Posted Image

Is This A Good Question/Topic? 0
  • +

Replies To: HTML/CSS in a .NET markup with issues

#2 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 339
  • Joined: 10-November 09

Re: HTML/CSS in a .NET markup with issues

Posted 24 January 2013 - 09:56 AM

Never mind, I got it. I just took it out and moved the style sheet link up to the normal area with all the other style sheet stuff.
It works, now.

Thanks, anyway.
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3515
  • View blog
  • Posts: 10,140
  • Joined: 08-June 10

Re: HTML/CSS in a .NET markup with issues

Posted 24 January 2013 - 10:10 AM

1) cf. https://developer.mo...s/CSS/@document, basically an experimental browser-specific rule targeted at URL selections

2) it should be placed inside <style> tags, preferably placed in the HTML head

3) possible, since no URL is given (which is rather pointless in an URL-based selector)


If you want to target IE, use IE’s conditional comments. they’re proved to work.
Was This Post Helpful? 1
  • +
  • -

#4 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 339
  • Joined: 10-November 09

Re: HTML/CSS in a .NET markup with issues

Posted 24 January 2013 - 10:22 AM

Ah, thanks for that! #1 makes sense now. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1