首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Internet Explorer固定位置不能正常工作

Internet Explorer固定位置不能正常工作
EN

Stack Overflow用户
提问于 2012-01-06 13:22:25
回答 2查看 1.8K关注 0票数 0

我的导航栏和twitter框显示不正确。这些都是固定的。如果你看到它们当前在页面的底部。他们不该在的地方。

在我网站的其他页面上,这两个元素即使在IE中也能正常工作。我的主页的页眉和页脚与我的其他页面不同,所以我试图找出问题所在,但即使我去掉了除导航栏和twitter框之外的所有代码,这个问题似乎仍然存在,这真的让我感到困惑。

我被难住了,现在看不清楚了。我只是想在IE的脸上打一拳,但我知道这可能是我最近做的或改变的事情,因为这种情况过去不会发生。

还有一些似乎也在同一时间受到影响的东西,我猜是相关的,当你点击登录链接时,就会从顶部图像和登录表单部分分离出来。同样,这只发生在我的主页上,但在这种情况下,在表单中的日志,它也显示在Chrome中。

有没有人能帮我解决这个问题,这样我就可以继续我的生活了。(我正在使用IE8进行测试)

谢谢!

编辑

我从下面的答案中注意到,我的不知何故在我的body标签中。然而,这是我的代码,它显然不在我的body标记中,并且是代码的第一行。当然,除了这个页面是一个自定义的wordpress模板,我把模板的名字放在了顶部。标签似乎是空的,我所有的head声明也都在body中。非常奇怪..。有没有人知道为什么会发生这种事。它似乎在所有浏览器上都有。下面是我的整个页面代码。

代码语言:javascript
复制
<?php
/*
Template Name: Home Page
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0     Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">     <title><?php bp_page_title(); ?></title>  <?php do_action( 'bp_head' ); ?>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->       <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />        <?php if ( function_exists( 'bp_sitewide_activity_feed_link' ) ) : ?>           <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php _e('Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />     <?php endif; ?>     <?php if ( function_exists( 'bp_member_activity_feed_link' ) && bp_is_member() ) : ?>           <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />        <?php endif; ?>     <?php if ( function_exists( 'bp_group_activity_feed_link' ) && bp_is_group() ) : ?>         <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />        <?php endif; ?>     <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts RSS Feed', 'buddypress' ) ?>" href="<?php bloginfo('rss2_url'); ?>" />     <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts Atom Feed', 'buddypress' ) ?>" href="<?php bloginfo('atom_url'); ?>" />       <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />       

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-21029219-7']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

<!-- script for glossary highlight -->
<script type="text/javascript" src="https://www.aapltrader.com/wp-content/themes/Equilibrium/js/highlight.js"> </script>


<script type='text/javascript'>

// Browser safe opacity handling function

function setOpacity( value ) {
 document.getElementById("styled_popup").style.opacity = value / 10;
 document.getElementById("styled_popup").style.filter = 'alpha(opacity=' + value * 10 + ')';
}

function fadeInMyPopup() {
 for( var i = 0 ; i <= 100 ; i++ )
   setTimeout( 'setOpacity(' + (i / 10) + ')' , 8 * i );
}

function fadeOutMyPopup() {
 for( var i = 0 ; i <= 100 ; i++ ) {
   setTimeout( 'setOpacity(' + (10 - i / 10) + ')' , 8 * i );
 }

 setTimeout('closeMyPopup()', 800 );
}

function closeMyPopup() {
 document.getElementById("styled_popup").style.display = "none"
}

function fireMyLoginPopup() {
 setOpacity( 0 );
 document.getElementById("styled_popup").style.display = "block";
 fadeInMyPopup();
}
function fireMyStockChartPopup() {
 setOpacity( 0 );
 document.getElementById("stockChart").style.display = "block";
 fadeInMyPopup();
}
</script>
<?php wp_head(); ?>

    </head>



    <body>

<div id='styled_popup' name='styled_popup' style='width: 380px; height: 300px; display:none; position: absolute; top: 50px; left: 50px; zoom: 1'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>

<td height='38' class='login-top'><a class="login-close" href='javascript:fadeOutMyPopup();'>X</a></td>
</tr>

<tr><td colspan='2' style='background-color: #686868; width: 380px; height: 200px;-moz-border-radius:  15px 0 15px 15px;
border-radius: 15px 0  15px 15px;'>

<form name="loginform" id="loginform" action="http://www.aapltrader.com/wp-login.php" method="post">

            <p class="login-username">
                <label for="user_login">Username</label>
                <input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" />
            </p>
            <p class="login-password">
                <label for="user_pass">Password</label>
                <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" />
            </p>
            <a class="login-forgot" href="http://www.aapltrader.com/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a>
            <p class="login-remember"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
            <p class="login-submit">
                <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
                <input type="hidden" name="redirect_to" value="http://www.aapltrader.com/activity/" />
            </p>

        </form>



</td></tr>
</table>
</div>



<div id="container-sales">
  <div id="top-sales">
        <!-- <h1 class="logo"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1> -->
        <a style="padding-left:0px;" href="<?php bloginfo('home'); ?>"><img src="https://www.aapltrader.com/wp-content/uploads/2011/08/aapltraderlogo.gif"/></a>    
        </div>
    <div id="sales-background">
    <div id="page-wrap-sales">



<?php //get_header(); ?>

<div id="featured"> 



<div class="clear"></div>

<div id="front-bottom">
<div id="leftCol">

<span class="welcomeH2">Learn</span> <span class="welcomeTip">from Successful Traders </span>
<ul>
<li><span class="welcomeText">Tap a global network of AAPLTraders and expand your own trading style!</span></li>
</ul>

<span class="welcomeH2">Connect</span><span class="welcomeTip"> to a Community</span>
<ul>
<li><span class="welcomeText">Share ideas in the AAPLTrader Community Room. Refine your ideas through active groups.</span></li>
</ul>

<span class="welcomeH2">Grow</span><span class="welcomeTip"> Profits</span>
<ul>
<li><span class="welcomeText">Find out what strategies are currently profiting. Get AAPL Alerts during the week and stay plugged in.</span></li>
</ul>
<a href="https://www.aapltrader.com/checkout-2?subscription=2&claim=49d393ce7e1346fa24cecd5d0eb1533d" class="green-button">Get AAPLTrader</a>
<ul style="margin:0 0 0 0;padding:0 0 0 0;">
<li><span  style="font-size:1.5em;padding:10px 0px 0 88px;"> Premium Access  </span><span style="font-size:1.2em;color:#575958;">   $19.99/month</span></li>
<br /><br />
<li> <span style="font-size: 1.4em;color: white;padding: 0px 0px 0 80px;font-weight: bold;">30 Day Money Back Guarantee </span></li>
</ul>
</div>



<div id="sales-video">




 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="530" height="400" id="csSWF">
                <param name="movie" value="http://www.howtousethinkorswim.com/media/appletrader/justmetus/media/player.swf" />
                <param name="quality" value="best" />
                <param name="wmode" value="transparent" />
                <param name="bgcolor" value="#1a1a1a" />
                <param name="allowfullscreen" value="true" />
                <param name="scale" value="showall" />
                <param name="allowscriptaccess" value="always" />
                <param name="flashvars" value="thumb=http://www.howtousethinkorswim.com/media/appletrader/justmetus/media/FirstFrame.png&containerwidth=530&containerheight=400&content=justmetus.mp4&autostart=false&blurover=false&autohide=true&smoothing=true&showbranding=false&showstartscreen=true&color=0x1A1A1A,0x1A1A1A" />
                <!--[if !IE]-->
                <object type="application/x-shockwave-flash" data="http://www.howtousethinkorswim.com/media/appletrader/justmetus/media/player.swf" width="530" height="400">
                    <param name="quality" value="best" />
                    <param name="wmode" value="transparent" />
                    <param name="bgcolor" value="#1a1a1a" />
                    <param name="allowfullscreen" value="true" />
                    <param name="scale" value="showall" />
                    <param name="allowscriptaccess" value="always" />
                    <param name="flashvars" value="thumb=http://www.howtousethinkorswim.com/media/appletrader/justmetus/media/FirstFrame.png&containerwidth=530&containerheight=400&content=justmetus.mp4&autostart=false&blurover=false&autohide=true&smoothing=true&showbranding=false&showstartscreen=true&color=0x1A1A1A,0x1A1A1A" />
                <!--![endif]-->

                <!--[if !IE]-->
                </object>
                <!--![endif]-->
            </object>



</div>






 <div class="clear"></div>

 </div>


 </div>
<div class="clear"></div>

<div id="latest-wrap">

<div class="content-sales">

<h2 >How it works?</h2> <br /> 

<span class="content-sales-p"> AAPLTrader is a social networking website similar to facebook. We give people a place where they can connect with other like minded people who trade and invest.</span>  
<br /><br /> <br />
<span class="content-sales-p"> Members get access to:</span>
<ul style="font-size:1.4em;"><li style="list-style:disc outside none"><a href="http//www.aapltrader.com/what-is-aapltrader#alerts">AAPL Alerts</a></li>
<li style="list-style:disc outside none;"><a href="http//www.aapltrader.com/what-is-aapltrader#video-update">Video Updates </a></li>
<li style="list-style:disc outside none;"><a href="http//www.aapltrader.com/what-is-aapltrader#community">Community Room</a></li>
<li style="list-style:disc outside none;"><a href="http//www.aapltrader.com/what-is-aapltrader#groups">Groups</a></li> </ul>
<br /> <br />
<span class="content-sales-p">What makes AAPLTrader different are the AAPL Alerts and the Video Updates posted by the AAPLTrader Team on our exclusive wall. To get access, simply click the Get AAPLTrader Button or <a href="http://www.aapltrader.com/what-is-aapltrader">click here</a> for more info.</span>
</div>



<div id="testimonial">
<h2>Testimonials</h2>
<img style="float:left;margin:0 15px 10px 0;" src="<?php bloginfo('template_directory'); ?>/images/quotes.gif" title=" testimonial quotes" />
<p><strong>"First of all I love your advice and analysis. So happy I found it. Its helping me to another level.
 I have been in the market for 30 plus years. I have been doing phenomenal."</strong><br /> <br /><span style="float:right;"> -Paul F. California </span></p>
<div class="clear"></div>
<span id="motto"> "The Facebook for Stock Traders." </span><br/><p> <span style="float: right;"> -Lisa T. New York</span></p>
 </div> 
 <div class="clear"></div>

<div class="push"></div>




</div> <!--Latest Wrap -->




</div> <!--Page Wrap--> 
</div> <!--Sales Background-->  
</div> <!--Container Sales-->
<div class="clear"></div>



<?php do_action( 'bp_after_container' ) ?>
        <?php do_action( 'bp_before_footer' ) ?>


<div id="footer-home">
  <div align="center">
<div class="footer-posts">
<?php
$args = array( 'numberposts' => 3 , 'category' => 4 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
    <div class="footer-post">
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_excerpt(); ?>
</div>
<?php endforeach; ?>
</div> <!-- /footer-posts -->
<div class="clear"></div>

          AAPLTrader &copy; 2011 All Rights Reserved. AAPLTrader does not have any association with Apple Inc. <br /><a href="http://www.aapltrader.com/privacy-policy">Privacy Policy</a> | <a href="http://www.aapltrader.com/house-rules">House Rules</a> | <a href="http://www.aapltrader.com/terms-of-use">Terms Of Use</a> | <a href="http://www.aapltrader.com/cancellation-policy">Cancellation Policy</a> | <a href="http://www.aapltrader.com/disclaimer">Disclaimer</a> | <a href="http://www.aapltrader.com/wp-content/uploads/2010/06/riskstoc.pdf"> Risk of Stocks, Options, Commodities </a><br />

<?php if ( is_user_logged_in() ) { ?> <a href="http://www.aapltrader.com/affiliate-member"> Affiliate Information </a>  |<?php } else { ?><a href="http://www.aapltrader.com/affiliates-info"> Affiliate Information </a>  |<?php  } ?> 

 <a href="http://www.aapltrader.com/contact-us"> Contact Us </a></div>
        <p class="floatRight"></p>
        <div class="push"></div>

<?php do_action( 'bp_footer' ) ?>
</div>


<?php wp_footer(); ?>
<?php do_action( 'bp_after_footer' ) ?>

    </body>

</html>  
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-01-06 13:53:01

在IE中,您需要为固定位置添加适当的文档类型才能工作。

编辑:由于某种原因,您的文档类型定义不在第一行。请参阅下面的快照,

票数 3
EN

Stack Overflow用户

发布于 2012-01-06 13:37:48

你正在用xhtml编写代码,xhtml被设计为在每个浏览器中正确显示,当然这是假设你的xhtml代码通过了验证,但它没有通过。Firefox足够聪明,能够发现问题并为你解决问题,而IE则不然。请确保您的xhtml通过了验证,然后重试。

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.aapltrader.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8753719

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档