Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member Charles Francis's Avatar
    Join Date
    Aug 2011
    Location
    Florida
    Posts
    28
    Member #
    29065
    Hello All,

    I am having a small issue lining certain things up between the PC versions of some modern day browsers and the Mac versions of the same modern day browsers… I have searched the web for a "script" of some sort to first be able to target whether the user is on a PC or Mac, and then run specific CSS Hacks to target between Firefox, Chrome, Internet Explorer, Safari, & Opera, to get my the website to look as "exact" as possible…

    [ SCREENSHOTS ATTACHED BELOW ]

    So to be clear… The design would look a certain way in Firefox's browser on a Mac but have minor differences here and there in PC's version of the Firefox browser… And has been confirmed in other browsers swell.. meaning there would be small differences from Mac's Chrome browser and PC's Chrome browser, so on & so forth…

    I have used a reset.css file to remove any "extra browser specific" styles or custom browser spacing…

    Through trial and error I have been able to bring certain things in a little closer but there are some things just wont cooperate…

    One of my main problems right now is that main menu bar, It needs to be lined up in both PC and Mac, but if I move it in Firefox (on a MAC) it moves in Firefox (on a PC) which is why I cant use browser specific CSS hacks…

    What would I do in a situation like this?

    Thanks for your help in advance!


    [ ----------- PC/Mac Screenshots from 5 of the Most Modern Browsers ---------- ]

    Mac / Firefox 5



    Mac / Safari



    Mac / Opera



    Mac / Chrome



    PC / Firefox 7 Beta



    PC / Safari



    PC / Internet Explorer 9



    PC / Chrome


  2.  

  3. #2
    Banned
    Join Date
    May 2011
    Location
    Fairfax, CA
    Posts
    2,036
    Member #
    28003
    Liked
    126 times
    Well, both systems have different default fonts. Not sure if that's causing your problem though,.

  4. #3
    Junior Member Charles Francis's Avatar
    Join Date
    Aug 2011
    Location
    Florida
    Posts
    28
    Member #
    29065
    Here is a link to the page described here http://www.pilcreativegroup.com/clients/IDR/beta-site/

    Maybe you can see whats going on here?

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    It's actually a known issue because although your using the same browser, the browser engines on Mac and pc are different because of the display differences.

    There are quite a few JavaScripts that can be runs to load the specific CSS for the specific browser. Load the closest one you've got for anyone that has JavaScript turned off completely, but that will be a very small group.

    In ASP, there is a way to detect os and browser and version, then set a session variable to load a specific CSS while the session is active. Much easier on the server and visitor. I'm sure there is a way to do the same in php, but I don't know enough php to help you with that.

  6. #5
    Junior Member Charles Francis's Avatar
    Join Date
    Aug 2011
    Location
    Florida
    Posts
    28
    Member #
    29065
    Quote Originally Posted by Webzarus, post: 217887
    It's actually a known issue because although your using the same browser, the browser engines on Mac and pc are different because of the display differences.

    There are quite a few JavaScripts that can be runs to load the specific CSS for the specific browser. Load the closest one you've got for anyone that has JavaScript turned off completely, but that will be a very small group.

    In ASP, there is a way to detect os and browser and version, then set a session variable to load a specific CSS while the session is active. Much easier on the server and visitor. I'm sure there is a way to do the same in php, but I don't know enough php to help you with that.
    Ok good thats reassuring that others have had this same problem, because its actually the 1st time that I have encountered this and I have been designing & developing websites for awhile now...

    Ok so just to clarify.... as far as HTML & CSS goes, there is "no way" at all to line that main menu bar up in both platforms without going into asp or php... right?

  7. #6
    Junior Member Charles Francis's Avatar
    Join Date
    Aug 2011
    Location
    Florida
    Posts
    28
    Member #
    29065
    [COLOR=rgb(0, 0, 0)][COLOR=rgb(20, 20, 20)]I dont really know ASP but to correct this issue for the client I am willing to try & learn... Now in the sense that I can rename my [ .html ] files to [ .php ] files and they are able to co-exist with my other [ .html ] files without problem...

    Would I be able to incorporate that ASP detection script with the current website that was built in HTML, CSS, & Dynamic PHP (which is our Shopping Cart) by just including / renaming an ASP page? Or would the site have to had to been built in ASP from the get go?
    [/COLOR][/COLOR]

  8. #7
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    You don't need to use ASP to check for browser or OS, you can do it with PHP.

    [COLOR=rgb(28, 40, 55)]$_SERVER["HTTP_USER_AGENT"];[/COLOR]

    [COLOR=rgb(28, 40, 55)]gives you all the information you need to know. The problem is then it produces a string, such as:[/COLOR]
    [COLOR=rgb(28, 40, 55)]
    [/COLOR]

    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

    So you would say something like..

    if ([COLOR=rgb(28, 40, 55)]strpos([/COLOR][COLOR=rgb(28, 40, 55)]$_SERVER["HTTP_USER_AGENT"][/COLOR][COLOR=rgb(28, 40, 55)], 'Macintosh')) {[/COLOR]
    print '[COLOR=rgb(0, 0, 0)]<link rel="stylesheet" type="text/css" href="macstyle.css" />'[/COLOR]
    [COLOR=rgb(28, 40, 55)]}[/COLOR]
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  9. #8
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Sorry, asp is a windows server scripting language ... And can only be run on a windows server. That's why I mentioned php. Php runs on Linux servers. Its actually more powerful than asp, but I know enough php to get myself in trouble.

    There are some others here that know a lot more about php and what it can do.

    In the meantime, search for JavaScript browser detection script... You should get lots of options until some can provide you a php solution ( assuming you're on a Linux server )

  10. #9
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    See before I could finish, someone answered.

  11. #10
    Junior Member Charles Francis's Avatar
    Join Date
    Aug 2011
    Location
    Florida
    Posts
    28
    Member #
    29065
    Quote Originally Posted by Ganners, post: 217899
    You don't need to use ASP to check for browser or OS, you can do it with PHP.

    [COLOR=rgb(28, 40, 55)]$_SERVER["HTTP_USER_AGENT"];[/COLOR]

    [COLOR=rgb(28, 40, 55)]gives you all the information you need to know. The problem is then it produces a string, such as:[/COLOR]

    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

    So you would say something like..

    if ([COLOR=rgb(28, 40, 55)]strpos([/COLOR][COLOR=rgb(28, 40, 55)]$_SERVER["HTTP_USER_AGENT"][/COLOR][COLOR=rgb(28, 40, 55)], 'Macintosh')) {[/COLOR]
    print '[COLOR=rgb(0, 0, 0)]<link rel="stylesheet" type="text/css" href="macstyle.css" />'[/COLOR]
    [COLOR=rgb(28, 40, 55)]}[/COLOR]
    Hey Ganners, thanks for the info!

    So just to be clear... using the info you posted... how would I call a stylesheet written for Chrome on a PC?

    Would it be something like...

    PHP Code:
    if (strpos($_SERVER["HTTP_USER_AGENT"], 'PC')) {
    print 
    '<link rel="stylesheet" type="text/css" href="chromeStyles.css" />'

    [COLOR=rgb(28, 40, 55)]And where in this code would I call the chrome browser?[/COLOR]


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

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

Search tags for this page

css target chrome on pc

Click on a term to search for related topics.
All times are GMT -6. The time now is 06:26 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com