<!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>

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
