2017-10-03 29 views
-1

내 외부 스타일 시트가 브라우저에서 렌더링되지 않는 사람이 있습니까?외부 CSS가 브라우저에서 렌더링되지 않음

두 파일이 모두 같은 디렉토리에 있습니다. 여러 브라우저를 사용해 본 결과 여러 번 캐시가 모두 지워졌습니다. 이것은 외부 스타일 시트를 처음 사용하기 때문에 작을 수도 있지만, 모든 것이 옳았 기 때문에 완전히 잃어 버렸습니다. 마이클 플랫 의해 제공

heading { 
 
    font-family: arial; 
 
    color: red; 
 
} 
 

 
emphasis { 
 
    color: blue; 
 
    background-color: yellow; 
 
}
<h1 class="heading">Cascading Style Sheets</h1> 
 
<h2>Benefits</h2> 
 
<p>Cascading Style Sheets offer many benefits to web designers. <em class="emphasis">CSS lets you separate style information from HTML</em>, allowing you to provide style sheets for different destination media as your web site requires. You can control the 
 
    display characteristics of an entire web site with a single style sheet, making maintenance and enhancements of display information a less taxing chore. You can express a wide range of style properties that increase the legibility, accessibility, and 
 
    delivery of your content. You can build page layouts, either flexible, fixed, or responsive to suit your user and content needs. As you will see in this chapter and through the rest of the book, CSS is easy to learn and apply to your web design projects.</p>

+0

html (제목, 강조)에 해당 요소가 없습니다. 너는. 강조와 머리가있다. 당신은 CSS의 수업 전에 포인트가 필요합니다 –

+0

이것은 오타이지만 css에서는'heading' 대신'.heading'이어야합니다. 외부 CSS 파일의 클래스는 항상'.'이 붙어 있습니다. –

+0

@MichaelPlatt 당신도 그렇게 많이 문제가되어 줘서 고맙습니다. 유효성 검사기가 그걸 알아 채지 못해서 놀랍습니다. 다시 한 번 감사드립니다! – Noah210012

답변

0

css에서 문장의 시작 부분에 점이 표시되지 않았습니다.

.heading { 
    font-family: arial; 
    color: red; 
} 

.emphasis { 
    color: blue; 
    background-color: yellow; 
} 
2

해결책 : 외부 CSS에서

각 클래스 따라서 .

에 선행되어야한다

.heading{ 
    font-family: arial; 
    color: red; 
} 

.emphasis{ 
    color: blue; 
    background-color: yellow; 
} 

인가 근원 요법 솔루션.