2

我已经编写了一个 HTML/CSS 网站,我从给定的 CSS 模板网站修改了该网站。

我已经针对 Chrome、Opera、Safari 进行了检查,它运行良好。

问题是,当涉及到 Firefox 时,它只显示徽标和一些非常基本的导航内容。

我希望有更多网络编程经验的人可以看看,让我知道可能出了什么问题。

我讨厌问这样一个笼统的问题,但我真的不知道发生了什么。您可以在此处找到该网站:matroscoe.ca

提前感谢您的帮助或指点!

<?php require('./blog/wp-blog-header.php'); ?>
<!DOCTYPE html>

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js" lang="en" id="index"> <![endif]-->

<head>
    <!-- Analytics -->
    <?php include_once( "php/analytics.php" ); ?>

    <base href="http://matroscoe.ca" /> 
    <title>Home \\ Mat Roscoe</title>

    <!-- SEO Information -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <meta name="description" content="This website provides current information on the research and work of Matthew Roscoe">
    <meta name="author" content="Matthew Roscoe, Graduate Student, http://matroscoe.ca">

    <!-- Favicon -->
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
    <link rel="shortcut icon" type="image/png" href="favicon.png">

    <!-- CSS Style Sheets -->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/style.css">

    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>

<body>
<!-- Prompt IE 7 users to install Chrome Frame -->
<!--[if lt IE 8]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->

<div class="container">
    <script src="js/header.js" onload="header();"></script>

    <div class="home-page main">
       <section class="grid-wrap" >
          <header class="grid col-full">
            <hr>
            <p class="fleft">Home</p>
            <a href="about.php" class="arrow fright">more info</a>
        </header>

        <div class="grid col-one-half mq2-col-full">
            <h1>
                Robotics <br>
                A.I. <br>
                Computer Vision <br>
                Space Exploration
            </h1>

            <p align="justify">
                 I am a graduate student studying <a href="http://en.wikipedia.org/wiki/3D_computer_vision">3D Vision Systems</a>
                 and <a href="http://en.wikipedia.org/wiki/Artificial_intelligence">Artificial Intelligence</a> in robotic platforms. 
                 My goal is to work in space exploration robotics in the near future. 
            </p>
            <p align="justify">
                My current interests are focused around 3D object representation that has been afforded to us thanks to new RGB-D sensors. I am also investigating ways to learn about objects on the fly. 
                You can learn more about the project I am working on either through my <a href="#">Publications Page</a> or through my <a href="#"> Projects Page </a>. 
            </p>
        </div>


        <div class="slider grid col-one-half mq2-col-full">
            <div class="flexslider">
                <div class="slides">
                  <?php
                    global $post;
                    $args = array( 'posts_per_page' => 5 );
                    $myposts = get_posts( $args );
                    foreach( $myposts as $post ) :  setup_postdata($post); ?>
                    <div class="slide">
                        <figure>
                            <?php $args = array(
                               'post_type' => 'attachment',
                               'numberposts' => -1,
                               'post_status' => null,
                               'post_parent' => $post->ID
                              );

                              $attachments = get_posts( $args );
                                 if ( $attachments ) 
                                 {
                                       //echo wp_get_attachment_image( $attachment->ID, 'full' );
                                       $image_attributes = wp_get_attachment_image_src( $attachments[1]->ID, 'full' ); ?>
                                       <img class="front" src="<?php echo $image_attributes[0]; ?>" width="400px" height="370px">
                                 <?php } ?>
                            <figcaption> 
                            <div>
                                <h5><?php the_title(); ?></h5>
                                <?php the_excerpt(); ?>
                                <p class="readmore"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continue Reading &raquo;</a></p>              </div>
                             </figcaption>
                        </figure>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
    </section>
</div> <!--main-->
    <?php include("php/footer.php"); ?>
</div>

<!-- Javascript - jQuery -->
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>

<!--[if (gte IE 6)&(lte IE 8)]>
<script src="js/selectivizr.js"></script>
<![endif]-->

<script src="js/jquery.flexslider-min.js"></script>
<script src="js/scripts.js"></script>

<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(100591972);
(function() {
  var s = document.createElement('script');
  s.type = 'text/javascript';
  s.async = true;
  s.src = '//static.getclicky.com/js';
  ( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100591972ns.gif" /></p></noscript>
</body>
</html>
4

2 回答 2

2

我认为问题在于您输出<html>标签的条件注释。首先,它们似乎只针对 Internet Explorer,我看不到<html>普通浏览器会输出标签的情况。其次,最后的条件注释似乎有问题:

<!--[if gt IE 8]><!--> <html class="no-js" lang="en" id="index"> <!--<![endif]-->

应该是

<!--[if gt IE 8]> <html class="no-js" lang="en" id="index"> <![endif]-->

也就是说,我不确定它为什么会在 Chrome 中运行。我想这很可能是因为 Chrome 对损坏的条件注释和在其中应用<html>标签的反应不同,而 Firefox 没有。

另外,尝试添加一个最终的条件注释,如下所示:

<!--[if !IE]><html><![endif]--> 

以非 IE 浏览器为目标,看看是否有帮助。

于 2013-03-19T15:40:25.450 回答
0

我发现我的网站存在问题。问题是我使用 Javascript 来创建导航菜单,并且我将这与对 onload() 的错误调用联系在一起,即使这实际上从未发生过。一旦我将 Javascript 更改为更简洁的 PHP 版本,问题就消失了,我在使用 Firefox 浏览网站时没有任何问题。

我想将答案与其他答案分开发布,因为它已经足够不同了,但如果不是每个人都为我查看我的代码并提出建议,我什至都不会发现错误。感谢大家帮助我启动并在另一个浏览器上运行!

于 2013-03-20T21:02:58.477 回答