The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Target specific browsers with HTML, load separate stylesheets

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #37225

    I’ve got a rather nice website going, but the alignment displays correctly in Safari but incorrectly in Firefox! If I tweak the alignment of the elements in the CSS, I can align it in Firefox correctly but then it looks all wrong in Safari!

    You can load specific stylesheets when your website detects Internet Explorer,

    but I can’t seem to find an equivalent workaround for Firefox. I’d love to have four of these workarounds, for Firefox, Chrome, Safari and Opera, which all link to corresponding stylesheets, but I can only find one for Internet Explorer :(


    This site isn’t letting me copy and paste code for some reason…
    have a look here to know what I’m on about:


    Instead of creating two stylesheets for two different browsers, I would just try to fix the issue so that it displays the same in both browsers. It shouldn’t be too much of an issue, if you show us what the problem is then we can try to help out with that.


    you can achieve this with php . I use php to detect mobile or desktop browsers. For firefox you just need to add

    Type = "text/css">

    You should use it in index.php or something.php not .html or .htm


    I’m with karl and senff. Try resetting your margins/padding, and possibly using box-sizing: border-box as outlined here:

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.