2016-06-13 4 views
1

Я кодирую из книги, Научись Code: HTML и CSS г-ном Шаем Хоу, и столкнулся с проблемой с моим кодом.Что такое ошибка синтаксического анализа CSS и как его исправить?

Я использую скобки Adobe в качестве текстового редактора, и, глядя на мой предварительный просмотр в прямом эфире, он не выглядел так, как должен был выглядеть, поэтому я поместил его в службу W3C CSS Validation, и он сказал, что у меня есть синтаксический анализ ошибка. Вот мой код (проблемная область):

h1, h3, h4, h5, p { 
margin-bottom: 22px; 
} 

<a class="btn-alt"></a> 

/* 
============================================== 
Buttons 
============================================== 
*/ 

.btn { 
border-radius: 5px; 
display: inline-block; 
margin; 0; 
} 

.btn-alt { 
border: 1px solid #dfe2e5; 
padding: 10px 30px; 
} 

И мой HTML:

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>Styles Conference</title> 
    <link rel="stylesheet" href="assets/stylesheets/stylesconference.css"> 
</head> 

<header> 
<section class="container"> 
<h1> 
<a href="stylesconference.html">Styles Conference</a> 
</h1> 
</section> 
<h3>August 24&mdash;26th &mdash; Chicago, IL</h3> 
<nav> 
<a href="stylesconference.html">Home</a> 
<a href="speakers.html">Speakers</a> 
<a href="schedule.html">Schedule</a> 
<a href="venue.html">Venue</a> 
<a href="register.html">Register</a> 
</nav> 
</header> 
<header class="container"></header> 

<section> 
<h2>Dedicated to the Craft of Building Websites</h2> 
<p>Every year, the brightest web designers and front-end developers descend on Chicago to discuss the latest technologies. Join us this August!</p> 
<a href="register.html">Register Now</a> 
</section> 
<section class="hero container"></section> 

<section> 

<section> 
<a href="speakers.html"> 
    <h5>Speakers</h5> 
    <h3>World-Class Speakers</h3> 
</a> 
    <p>Joining us from around the world are over twenty fantastic speakers, here to share their stories.</p> 
</section> 
<section class="container"></section> 

<section> 
<a href="schedule.html"> 
    <h5>Schedule</h5> 
    <h3>Three Inspiring Days</h3> 
</a> 
    <p>Enjoy three inspiring and action-packed days of talks, gatherings, and all-around good times.</p> 
</section> 

<section> 
<a href="venue.html"> 
    <h5>Venue</h5> 
    <h3>The Chicago Theatre</h3> 
</a> 
    <p> Within the heart of downtown Chicago, The Chicago Theatre will provide a beautiful conference venue.</p>  
</section> 

</section> 
<section class="container"></section> 

<footer> 
    <small>&copy; Styles Conference</small> 
     <nav> 
     <a href="stylesconference.html">Home</a> 
     <a href="speakers.html">Speakers</a> 
     <a href="schedule.html">Schedule</a> 
     <a href="venue.html">Venue</a> 
     <a href="register.html">Register</a> 
     </nav> 
</footer> 
<footer class="container"></footer> 
</html> 
+2

Это эквивалент «официант, в моем супе есть волосы». –

+0

Создайте [Полный, минимальный, проверенный пример] (http://stackoverflow.com/help/mcve). –

ответ

3

Там в HTML тег в строке 5 файла CSS:

<a class="btn-alt"></a> 

Я DON» t знать, если это опечатка в фактическом коде или результат вашего размещения здесь, но это проблема.

Там также точка с запятой, когда оно должно быть двоеточие в строке 16, ваш последний стиль для .btn класса:

margin; 0; 

Это должно быть:

margin: 0; 
0

Просто удалить тег <a class="btn-alt"></a> и он может работать

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