안녕하세요, 내 CSS에서 "* {여백 : 0; 패딩 : 0;}"을 재정의하는 방법에 대한 도움이 필요합니다.CSS * {여백 : 0; 패딩 : 0;}
이유 왜 나는이 CSS를 가지고 :
.postcomments { width: 547px; padding: 5px 5px 5px 5px; margin: 0 0 5px 0;}
.postcomments a { text-decoration: underline;}
.postcomments ul { margin: 0; padding: 0; list-style-type: none;}
.postcomments ul li { width: 547px; margin: 0 0 5px 0; padding: 0; list-style-type: none;}
.postcomments .right { color: #474747; font-size: 11px; background: #fff url('http://www.nextbowluser.com/img/ucBG.gif') no-repeat top left; line-height: 17px; padding: 5px 0 0 0; width: 430px; position: relative; float: right; min-height: 50px;}
.postcomments .right .bottom { padding: 0 5px 15px 5px; background: #fff url('http://www.nextbowluser.com/img/ucBG.gif') no-repeat bottom right; min-height: 50px;}
.postcomments .arrow { left: -15px; top: 20px; position: absolute;}
.avatar { border: none !important;}
.postcomments .left {float: left; margin: 0 7px 0 0;}
.postcomments .gravatar { background: #fff; width: 80px; height: 60px; margin: 0 0px 0 0; padding: 3px;}
.postcomments .name { font-size: 11px; margin: 2px 0 0 0; color: #000;}
.avatar { border: none !important;}
을 그리고 그것은 *없이 잘 표시 {여백 : 0; 패딩 : 0;} :
1st comment
2nd comment
3rd comment
을 그러나, 내가 CSS에, 그것은 코멘트 스택 잘못 만드는 추가
1st comment
2nd comment
3rd comment
난 그냥 *를 취할 것을 {마진 : 0; 패딩 : 0 ;}하지만 페이지의 다른 일부는 올바르게 표시되어야합니다. 그래서 내 질문에, 어떻게 페이지의 해당 postcomments 부분에 대한 {margin : 0; 패딩 : 0;} 재정의 할 수 있습니다?
감사합니다. : O)
데이비드
UPDATE : 음. 여전히 올바르게 이해할 수는 없습니다. 마진을 뺀 후에 : 전체 사이트에 대해 0px - 사이트를 끔찍하게 보입니다. 그리고 마진을 추가해야한다면 : 0px를 페이지의 모든 요소에 추가하면 * 좋지 않은 것처럼 보일 것입니다. 나는 여전히 .postcomments 부분을 위해 우회 할 부분이 필요하다.
그냥하지 마세요. 모든 블록 요소에 여백/패딩을 지정하십시오. – BalusC
HTML 구조가 어떻습니까? 주석이 어느 정도 들여 쓰기가되는 것은 이상한 것 같습니다. – icio
Balus C가 맞습니다. 그러지 마. 그러나 필자의 본능은 마진 패딩을 변경하지 않은 앵커 요소 ('')가 있음을 알려줍니다. 당신은 또한'! important'의 사용을 배제하고 CSS Specificity를 조사해야합니다 - http://www.w3.org/TR/CSS2/cascade.html#specificity –