목차
css格式问题_html/css_WEB-ITnose
Jun 21, 2016 am 09:20 AM<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#class3{ width:900px; margin-left:auto; margin-right:auto; position:relative; background-color:#099; margin-top:150px; }#class3 ul{ width:800px; height:30px; background-color:#936; margin-left:auto; margin-right:auto; position:relative; } #class3 li{ list-style-type: none; width: 100px; position:relative; margin-top:10px; float:left; background-color:#3F0; margin-right:10px; text-align:center; } #class2{ width:900px; margin-left:auto; margin-right:auto; position:relative; background-color:#099; height:50px; } #class2 li .01{ list-style-type: none; position: absolute; left: 670px; top: 23px;} .02{ list-style-type: none; position: absolute; left: 365px; top: 30px;}.03{ list-style-type: none; position: absolute; left: 308px; top: 30px;}.04{ list-style-type: none; position: absolute; left: -232px; top: 30px; } .05{ list-style-type: none; position: absolute; left: 201px; top: 30px;}.06{ list-style-type: none; position: absolute; left: 252px; top: 30px;}.07{ list-style-type: none; position: absolute; left: -97px; top: 28px;}</style></head><body><div id="class2"><ul><li class="01">横排</li><li class="02">横排</li><li class="03">横排</li><li class="04">横排</li><li class="05">横排</li><li class="06">横排</li><li class="07">横排</li></ul></div><div id="class3"><ul><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li></ul></div></body></html>
로그인 후 복사
.07{ list-style-type: none; position: absolute; left: -97px; top: 28px;}
로그인 후 복사
IE8浏览器为什么设置了类中的位置会无效,还是原来那样
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#box06 { position:relative; width: 500px; height: 100px; top:50%; left:50%; margin-left:-250px; margin-top:-50px; background-color:#F39;} #box07 { position:absolute; width: 300px; height: 30px; background-color:#0F0; left:50%; top:50%; margin-left:-150px; margin-top:-15px;} #box08 { position:absolute; width: 300px; height: 30px; background-color:#0Ff; left:30px; top:50%;}.nav{ width:500px; background-color:#000;}.nav li{width:80px;float:left;list-style:none;display:inline;background:#0F0;text-align:center;margin-right:10px;}</style></head><body><div class="nav"><ul><li>横排</li><li>横排</li><li>横排</li></ul></div><div> DIV1 </div><div> DIV2 </div><div style= "display:inline "> DIV1 </div><div style= "display:inline "> DIV2 </div><span>DIVCSS!</span> <span>DIVCSS5 </span> <span style= "display:block "> SPAN1 </span><span style= "display:block "> SPAN2 </span><div id="box06"> <div id="box07">box07</div> <div id="box08">box08</div></div></body></html>
로그인 후 복사
.nav{ width:500px; background-color:#000;}
로그인 후 복사
2、为什么类nav的这个黑色背景色出不来?
回复讨论(解决方案)
1class不要数字开头
2清除float
<div class="nav"><ul><li>横排</li><li>横排</li><li>横排</li> </ul> <div style="clear:both;"></div></div>
로그인 후 복사
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#class3{ width:900px; margin-left:auto; margin-right:auto; position:relative; background-color:#099; margin-top:150px; }#class3 ul{ width:800px; height:30px; background-color:#936; margin-left:auto; margin-right:auto; position:relative; } #class3 li{ list-style-type: none; width: 100px; position:relative; margin-top:10px; float:left; background-color:#3F0; margin-right:10px; text-align:center; } #class2{ width:100px; margin-left:auto; margin-right:auto; position:relative; background-color:#099; height:50px; } #class2 .c01{ list-style-type: none; position: absolute; left: 422px; top: 15px; width: 60px;} .c02{ list-style-type: none; position: absolute; left: 365px; top: 15px; width: 60px;}.c03{ list-style-type: none; position: absolute; left: 82px; bottom: 0px; right: 99px; top: 15px; height: 31px; width: 58px; top: 15px;}.c04{ list-style-type: none; position: absolute; left: -232px; top: 30px; top: 15px; } .c05{ list-style-type: none; position: absolute; left: 162px; top: 15px; width: 60px; height: 32px;}.c06{ list-style-type: none; position: absolute; left: 252px; top: 15px; width: 60px;}.c07{ list-style-type: none; position: absolute; left: -97px; top: 15px; width: 60px;}</style></head><body><div id="class2"><ul><li class="c01">横1排</li><li class="c02">横2排</li><li class="c03">横3排</li><li class="c04">横4排</li><li class="c05">横5排</li><li class="c06">横6排</li><li class="c07">横7排</li></ul></div><div id="class3"><ul><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li><li>横排</li></ul></div></body></html>
로그인 후 복사
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#box06 { position:relative; width: 500px; height: 100px; top:50%; left:50%; margin-left:-250px; margin-top:-50px; background-color:#F39;} #box07 { position:absolute; width: 300px; height: 30px; background-color:#0F0; left:50%; top:50%; margin-left:-150px; margin-top:-15px;} #box08 { position:absolute; width: 300px; height: 30px; background-color:#0Ff; left:30px; top:50%;}.nav{ width:500px; background-color:#000;}.nav li{width:80px;float:left;list-style:none;display:inline;background:#0F0;text-align:center;margin-right:10px;}</style></head><body><div class="nav"><ul><li>横排</li><li>横排</li><li>横排</li></ul> <div style="clear:both;"></div></div><div> DIV1 </div><div> DIV2 </div><div style= "display:inline "> DIV1 </div><div style= "display:inline "> DIV2 </div><span>DIVCSS!</span> <span>DIVCSS5 </span> <span style= "display:block "> SPAN1 </span><span style= "display:block "> SPAN2 </span><div id="box06"> <div id="box07">box07</div> <div id="box08">box08</div></div></body></html>
로그인 후 복사
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

인기 기사
스플릿 소설을이기는 데 얼마나 걸립니까?
3 몇 주 전
By DDD
Repo : 팀원을 부활시키는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
1 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌

인기 기사
스플릿 소설을이기는 데 얼마나 걸립니까?
3 몇 주 전
By DDD
Repo : 팀원을 부활시키는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
1 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제
Gmail 이메일의 로그인 입구는 어디에 있나요?
7279
9


자바 튜토리얼
1622
14


Cakephp 튜토리얼
1340
46


라라벨 튜토리얼
1257
25


PHP 튜토리얼
1205
29



공식 계정 웹 페이지의 캐싱 업데이트에 어려움 : 버전 업데이트 후 사용자 경험에 영향을 미치는 이전 캐시를 피하는 방법은 무엇입니까?

HTML5 양식 유효성 검사 속성을 사용하여 사용자 입력을 유효성있게하려면 어떻게합니까?

& lt; iframe & gt; 꼬리표? 보안을 사용할 때 보안 고려 사항은 무엇입니까?

웹 페이지의 PNG 이미지에 뇌졸중 효과를 효율적으로 추가하는 방법은 무엇입니까?

뷰포트 메타 태그는 무엇입니까? 반응 형 디자인에 중요한 이유는 무엇입니까?

iframes 사용의 보안 영향은 무엇이며 어떻게 완화 할 수 있습니까?
