0

我这里有一个模型

http://dummytest.herokuapp.com/

目前,普通的普通 HTML 首先显示,然后闪烁,并使用 CSS 呈现。如何让我的页面将 CSS 样式显示为完全绕过无样式文本的第一件事?

4

3 回答 3

2

您的文档格式不正确(wiki),这导致了这种行为。

一般网页去:

<html>
 <head>
  <!-- meta tags go here along with title, 
      script links, and css style references -->
 </head>
 <body>
  <!-- elements for rendering go here -->
 </body>
</html>
于 2012-05-10T07:20:39.110 回答
1

您想更正您的 HTML 以符合HTML 标准

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>Test Harness</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 
    <!--<Le>HTML5 shim, for IE6-8 support of HTML elements</Le>--><!--[if lt IE 9]> 
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--><!--<Le>styles</Le>--> 
    <link href="/stylesheets/bootstrap.css" rel="stylesheet"> 
    <link href="/stylesheets/datepicker.css" rel="stylesheet"> 
    <link href="/stylesheets/style.css" rel="stylesheet"> 
    <style>body { 
        padding-top: 30px; /* 60px to make the container go all the way to the bottom of the topbar */ 
    } 
    </style> 
    <script src="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js"></script> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script> 
    <script src="/javascripts/slimScroll.min.js"></script>    
    <script src="/javascripts/housefix.js"></script>  
    <script src="/javascripts/bootstrap-transition.js"></script> 
    <script src="/javascripts/bootstrap-alert.js"></script> 
    <script src="/javascripts/bootstrap-datepicker.js"></script>     
    <script src="/javascripts/bootstrap-modal.js"></script> 
    <script src="/javascripts/bootstrap-dropdown.js"></script> 
    <script src="/javascripts/bootstrap-scrollspy.js"></script> 
    <script src="/javascripts/bootstrap-tab.js"></script> 
    <script src="/javascripts/bootstrap-tooltip.js"></script> 
    <script src="/javascripts/bootstrap-popover.js"></script> 
    <script src="/javascripts/bootstrap-button.js"></script> 
    <script src="/javascripts/bootstrap-collapse.js"></script> 
    <script src="/javascripts/bootstrap-carousel.js"></script> 
    <script src="/javascripts/bootstrap-typeahead.js"></script> 
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
</head>  
<body> 
    <p> 
        <a href="/">Home</a> |  
        <a href="/login">Log In</a> 
    </p> 
    <h2>Welcome! Please log in.</h2> 
</body> 
</html>
于 2012-05-10T07:39:13.290 回答
0

将所有<head></head>代码放在一个地方,并将所有<body></body>代码放在一个地方。目前您有 2 套<head><body>。取上面的一个(带菜单)并将其与下面的一个(带有欢迎信息)合并。

最好通过http://validator.w3.org/运行所有网页,以避免将来出现此类问题。

于 2012-05-10T07:28:11.817 回答