• site link: http://www.fish-fry.com/dev

    To my knowledge it was browser that would make the difference in how a sit looks, but this site I just finished, looks fine in all browsers on mac, but the header elements are all out of whack on every browser when viewed from PC.

    I’ve been searching for an answer for quite sometime to no avail, perhaps I need a spinet of code in my header to call a different stylesheet pending the platform?

    Anyways, any help is greatly appreciated!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter eric brockman

    (@eric-brockman)

    I’ve found a script that will target platforms and call different css, but it doesn’t seem to be working. Are there any glaring mistakes that stick out to anyone?

    <script type="text/javascript">
    } if (navigator.userAgent.indexOf('Windows NT')) {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style-windows.css" />');
    }
    else {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />');
    }
    </script>

    thanks,

    I’m wondering if using the <header> tag for the styles is the culprit — it’s not supported consistently especially in pre-9 IE. You could try changing that to <div id="header"> and changing the CSS to#header` to see if that makes a difference.

    You also do not have a position for header — but everything else in the header section is using absolute positioning — so they are relative to the wrap div. Again, just a guess.

    If neither of those seem relevant:
    As mentioned in your earlier thread on this question, I’ve never heard of platforms causing differences — browsers, yes. What differences are you seeing? Have you cleared the browser caches on both machines? Have you tested on more than one PC and Mac (i.e. verify that the differences are consistent across more than one machine)?

    I see that you did clean up all mark-up errors — way to go! Not often to see a site come up completely clean on the validator — impressive!

    Some CSS “errors” but none that look problematic and most due to coding standards, etc.

    Thread Starter eric brockman

    (@eric-brockman)

    Thanks Yogi, yeah, markup is clean, as for css the only errors seem to be related to the things like “-moz-border-radius”.

    Interesting about the header info, I’ll try those out and see what happens.

    To answer your question, I’ve checked on multiple computers (both platforms and all major browsers). I’ve cleaned cache, temp internet files and cookies many times.

    difference are things like Mac – FF: all lined up, PC – FF: nav bar is 1px higher and search input is 2px lower. This sounds minor, but one some things are going up adn others down it creates a pretty visible mess.

    Many people have told me platforms won’t make a difference, only browser, don’t know what to say except it looks fine on mac, and different on every browser on PC – not just ie. ff, safari and chrome too!

    Anyways, I’ll try out what you suggested re: header.

    thanks again,

    One other thing that I just noticed is that the search form is actually BELOW the nav bar in the HTML code — so you are moving it up by using CSS to push the nav bar below it? That may be problematic as well. Can you change the HTML (header.php) code to move that search box — seems a bit more tidy & logical, though maybe there is something I’m missing?

    Thread Starter eric brockman

    (@eric-brockman)

    Thanks,

    So let me see if I understand correctly, here’s my HTML:

    <div id="header">
            <div id="logo">
    
    	    <a href="<?php bloginfo('url'); ?>"><img class="title" src="<?php bloginfo('template_directory'); ?>/images/logo.png?>"/></a>
    
    	</div><!--logo-->
    
    <div id="nav">
    	    <?php wp_nav_menu( array('theme_location' => 'topnavmenu')); ?>
    </div>
    
    	<form id="topsearch" class="search" method="get" action="<?php bloginfo('url'); ?>">
    	    <p class="fields">
    	        <input type="text" value="Search" name="s" id="s" onfocus="if (this.value == '<?php _e('Search'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Search'); ?>';}" /><button class="replace" type="submit" name="submit"><?php _e('Search'); ?></button>
    	    </p>
            </form><!--topsearch-->
    
    </div><!--header-->

    I thought if I define these div classes in my CSS as #header, #header #logo, #header #nav, #header #topsearch – that would line them all up, side-by-each within the div=header. Am I wrong, if so show should I define these to have them line up next to eachother within the header?

    It’s a wonder I can create a site like this from scratch and still not fully understand something this basic lol. #steeplearningcurve.

    thanks again for being so helpful!

    LOL! No, your site is really nice…clearly you’ve done a great job.

    I’m not totally clear on what you mean by “side-by-side.”

    My point was simply that the form div is in the html code below the nav bar — but you are using CSS to put it above the nav bar.

    Now I see that you’ve changed it — do you want the search above the nav bar? If so, in the header.php file, put the form div before (above) the logo div. Then it should be in the right place without all that CSS trying to move things around out of default order on the page. But you will then need to change the CSS accordingly…

    But actually, perhaps now is how you wnat that search to be — to the right of the menu? That’s not how it was before…

    I think maybe changing the header code fixed it?

    Thread Starter eric brockman

    (@eric-brockman)

    Thanks for the compliment, love learning this stuff! Yes, to the right of the nav bar is where I want it. side-by-each, sorry french canadian slang – lined up next to eachother, side-by-side.

    As for your header fix, it did seem to almost fix everything. Now it looks great on all browsers on Mac, and for the first time it’s consistent on all browser on PC, but there’s still an issue with how things are lining up on PC.

    Basically, the nav bar and the word “search” in the input box are both about 2px lower than they should be. It’s pretty visible on a PC that the nav bar is lower than the words “Fish Fry Music & Sound” and that the word “search” sits on the bottom of the input box, instead of the nice 2px padding you see on Macs.

    Getting closer!

    Sorry I was confused by side-by-side relative to the code — you made perfect sense. My bad :-(.

    Those last few tweaks are likely padding or margins somewhere in there…still seems very odd that it is platform related.

    Also maybe try conditional CSS if IE is the one having problems.

    Thread Starter eric brockman

    (@eric-brockman)

    It’s across the board on PC, all browsers. I’ll play with padding/ margins for a while, see if I can find a way to pull the nav and form input up 2px on PC without changing how it looks on Mac.

    thanks,

    Thread Starter eric brockman

    (@eric-brockman)

    After switching things to be defined by margin, to padding and then back again, it seems that’s not the issue. Still getting a 2px difference on all browsers when viewed by PC.

    So now I’m reverting back to looking for a way to target browsers and call different stylesheets.

    The following bit of code, does not seem to be working, but I’m looking for something like this:

    <script type="text/javascript">
    } if (navigator.userAgent.indexOf('Windows NT')) {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style-windows.css" />');
    }
    else {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />');
    }
    </script>

    Any help again is appreciated!
    cheers,

    Thread Starter eric brockman

    (@eric-brockman)

    So it was pointed out to me that I had a stray closing brace at the beginning of the script above. I’ve modified it slightly, but there must still be a mistake. When I open up firefox/ chrome from a PC it’s still reading ‘style.css’ as opposed to ‘windows-style.css’.

    Anyone familiar with this implementing this script?

    <script type="text/javascript">
    if (navigator.userAgent.indexOf('Windows NT')) {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style-windows.css" />');
    }
    elseif (navigator.userAgent.indexOf('Mac OS')) {
        document.write('<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />');
    }
    </script>

    Thanks a bunch!

    not that this is of any help, but, great looking site. very clean.

    Thread Starter eric brockman

    (@eric-brockman)

    Thanks @dirtydazz, I’m learning.

    cheers,

    Thread Starter eric brockman

    (@eric-brockman)

    I’ve tried this script too, seems that still, both platforms are only referencing ‘style.css’

    <script type="text/javascript">
    
    /***********************************************
    * Different CSS depending on OS (mac/pc)- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var csstype="external" //Specify type of CSS to use. "Inline" or "external"
    
    var mac_externalcss='http://www.fish-fry.com/dev/wp-content/themes/FISH-FRY-MUSIC-AND-SOUND-CUSTOM-THEME/style.css' //if "external", specify Mac css file here
    var pc_externalcss='http://www.fish-fry.com/dev/wp-content/themes/FISH-FRY-MUSIC-AND-SOUND-CUSTOM-THEME/style-windows.css' //if "external", specify PC/default css file here
    
    ///////No need to edit beyond here////////////
    
    var mactest=navigator.userAgent.indexOf("Mac")!=-1
    if (csstype=="inline"){
    document.write('<style type="text/css">')
    if (mactest)
    document.write(mac_css)
    else
    document.write(pc_css)
    document.write('</style>')
    }
    else if (csstype=="external")
    document.write('<link rel="stylesheet" type="text/css" href="'+ (mactest? mac_externalcss : pc_externalcss) +'">')
    
    </script>

    Any help? This is driving me bananas 😐

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Radical difference between mac and pc’ is closed to new replies.