2012-05-10 2 views
0

У меня есть макет здесьКак удалить мерцание с моей HTML-страницы?

http://dummytest.herokuapp.com/

На данный момент ясно, ваниль HTML показывает первый, а затем она мерцает и отображается с помощью CSS применяется. Как я могу заставить свою страницу показать стиль CSS как первое, что полностью обходит неровный текст?

+2

Вы должны очистить свой HTML код, первый: у вас есть несколько элементов DOCTYPE, головы и тела. см. http://html5.validator.nu/?doc=http%3A%2F%2Fdummytest.herokuapp.com%2F – fcalderan

ответ

1

Вы хотели бы исправить HTML, чтобы соответствовать HTML standard:

<!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> 
2

Ваш документ не является well formed (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> 
0

Поместите все свои <head></head> код в одном месте и все ваши <body></body> код в одном месте, а также. В настоящее время у вас есть 2 комплекта <head> и <body>. Возьмите один выше (с меню) и объедините его с приведенным ниже (с приветственным сообщением).

Лучше всего запустить все ваши веб-страницы через http://validator.w3.org/, чтобы избежать будущих проблем, подобных этому.

Смежные вопросы