나는 다음과 같은 코드를 가지고 :HTML + CSS : 'A'폭이 작동하지 않습니다
CSS 부분 :
<style type="text/css">
.menu
{
width:200px;
}
.menu ul
{
list-style-image:none;
list-style-type:none;
}
.menu li
{
margin:2px;
}
.menu A
{
height:25px;
width:170px;
background:url(./images/button-51.png);
padding:2px 5px ;
}
.menu A:link
{
height:25px;
width:170px;
background:url(./images/button-51.png);
padding:2px 5px ;
}
</style>
HTML 부분 :
모든 것이 잘 작동하지만, 내가 추가 할 때 HTML 문서 시작 부분의 'DOCTYPE'요소는 다음과 같습니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
'a'요소의 너비는 고려되지 않습니다.
질문 1 : 왜?
질문 2 : 어떻게 해결할 수 있습니까?
고맙습니다.
사람 와우
display: inline-block;
를 사용하여 같은 줄에있을 HTML과 CSS 코드에서 소문자를 사용 단지 나에게 두통의 톤을 저장! 앵커 태그의 폭을 조정할 수없는 이유를 알 수 없었습니다. – imjphttp://bit.ly/1QQi3Rd 좋은 답변입니다. – Luis