현재 http://meyerweb.com/eric/tools/css/reset/ 을 최상위 CSS로 사용하고 있습니다. 이것을 변경할 수 없다고 가정합니다.
그래서 내 최상위 CSS 수준은 다음과 같습니다.
base.css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}
div .target {
...
}
index.html
<body>
<div class="target">
<strong>Please make me bold</strong>
<i>Please make me italic</i>
</div>
</body>
어떤 이유로 font: inherit;
요소를 포맷 할 수 없습니다하는 것은 내 콘텐츠 예에 적용되는 <strong>
, <i>
등 나는 내에서 이러한 포맷의 HTML 태그를 사용할 수 있다고 기대했다 .target
그들을 내 CSS의 현재 구조를 올바르게 렌더링합니다. div p
이것이 작동 하도록 편집 할 수있는 방법 이 있습니까?
jsFiddle : https://jsfiddle.net/y4c3c9cb/6/
참고 : 상단 선택기 ( html, body, div,...
)는 이동, 편집 할 수 없으며 최상위 위치에 있어야합니다.
편집 내에서 어린이 .target
요소가 될 수 있습니다 것 i
, strong
, b
요소.
편집 2 : 변경된 HTML
이 재설정은 이러한 모든 태그에 대한 규칙을 직접 설정했음을 의미합니다. 가 포함되어 있기 때문에 strong { font: inherit; }
, 당신은 추가해야
strong {
font-weight: bold;
}
기울임 꼴과 동일 :
i {
font-style: italic;
}
... 또한 재설정 규칙에있는 다른 모든 태그에 대한 완전한 규칙도 있습니다. 그렇지 않으면 모든 것이 동일하게 보일 것입니다.
업데이트 된 바이올린 : https://jsfiddle.net/6nuogzg4/1/
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다