Please help me how to modify this css code_html/css_WEB-ITnose
请问怎么改CSS让它只对以下html代码起作用,现有的css好像是控制所有ul li的,但我只想控制下面html代码部分
以下html代码
<div class="right-extra" style="margin:100px;"> <!--产品参数开始--> <div> <div id="preview" class="spec-preview"> <span class="jqzoom"><img jqimg="images/b1.jpg" src="images/s1.jpg" /></span> </div> <!--缩图开始--> <div class="spec-scroll"> <a class="prev"><</a> <a class="next">></a> <div class="items"> <ul> <li><img alt="佳能" bimg="images/b1.jpg" src="images/s1.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b2.jpg" src="images/s2.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b3.jpg" src="images/s3.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b1.jpg" src="images/s1.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b3.jpg" src="images/s3.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b1.jpg" src="images/s1.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b2.jpg" src="images/s2.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b1.jpg" src="images/s1.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b2.jpg" src="images/s2.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b2.jpg" src="images/s2.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b1.jpg" src="images/s1.jpg" onmousemove="preview(this);"></li> <li><img alt="佳能" bimg="images/b2.jpg" src="images/s2.jpg" onmousemove="preview(this);"></li> </ul> </div> </div> <!--缩图结束--> </div>
以下CSS代码
img,ol,ul,li{margin:0;padding:0;}ol, ul{ list-style: none outside none;}.m { margin-bottom: 10px; }.m, .mt, .mc, .mb{ overflow: hidden; }/* Clear Fix */ .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;} .clearfix{display:inline-block;} /* Hide from IE Mac */ .clearfix{display:block;} /* End hide from IE Mac */ /* end of clearfix */ /*页面全局结束*/.tab{ overflow:hidden; }.tab li,.tab a,.tab-item{cursor:pointer;float:left;text-align: center;}.m, .mt, .mc, .mb{overflow:hidden;}.mt .extra{float: right;}.right-extra .mt{height:28px;line-height:28px;padding:0 10px 8px;border-top:1px solid #EED97C;background:url(../images/bg_hotsale.gif) repeat-x 0 -552px;color:#c00;}.right-extra .tab{border-bottom:2px solid #BE0000;margin-bottom:10px;}.right-extra .tab li{position:relative;height:24px;padding:3px 12px 0;background:url(../images/icon_clubs.gif) #ccc no-repeat right -150px;overflow:hidden;margin-right:3px;line-height:24px;font-size:14px;font-weight:bold;color:#c30;}.right-extra .tab span{position:absolute;left:0;top:0;z-index:1;width:10px;height:27px;background:url(../images/icon_clubs.gif) no-repeat 0 -150px;}.right-extra .tab a{float:none;color:#c30;}.right-extra .tab .curr{background-position:right -178px;color:#fff;}.right-extra .tab .curr span{background-position:0 -178px;}.right-extra .tab .curr a{color:#fff;}.right-extra .mc .extra{padding:5px 10px;border-top:1px solid #F3E6C6;}.right-extra .total{float:right;}.right-extra .total strong{color:#FF7403;}.right-extra .total a:link,.right-extra .total a:visited{color:#005aa0;}.right-extra .join a:link,.right-extra .join a:visited{color:#FF7604;}.right-extra .norecode{padding:0 10px 10px;}.right-extra .iloading{margin-bottom:10px;}/*图片放大镜样式*/.jqzoom{float:left;border:none;position:relative;padding:0px;cursor:pointer;margin:0px;display:block;}.zoomdiv{z-index:100;position:absolute;top:0px;left:0px;width:350px;height:350px;background:#ffffff;border:1px solid #CCCCCC;display:none;text-align:center;overflow:hidden;}.jqZoomPup{z-index:10;visibility:hidden;position:absolute;top:0px;left:0px;width:20px;height:20px;border:1px solid #aaa;background:#ffffff /*url(../images/zoom.png) 50% center no-repeat*/;opacity: 0.5;-moz-opacity: 0.5;-khtml-opacity: 0.5;filter: alpha(Opacity=50);}/*图片小图预览列表*/.spec-preview{width:350px;height:350px;border:1px solid #DFDFDF;}.spec-scroll{clear:both;margin-top:5px;width:352px;}.spec-scroll .prev{float:left;margin-right:4px;}.spec-scroll .next{float:right;}.spec-scroll .prev,.spec-scroll .next{display:block;font-family:"宋体";text-align:center;width:10px;height:54px; line-height:54px;border:1px solid #CCC;background:#EBEBEB;cursor:pointer;text-decoration:none;}.spec-scroll .items{float:left;position:relative;width:322px;height:56px;overflow:hidden;}.spec-scroll .items ul{position:absolute;width:999999px;height:56px;}.spec-scroll .items ul li{float:left;width:64px;text-align:center;}.spec-scroll .items ul li img{border:1px solid #CCC;padding:2px;width:50px;height:50px;}.spec-scroll .items ul li img:hover{border:2px solid #FF6600;padding:1px;}
回复讨论(解决方案)
类似这样的
.right-extra ul li {.....}
CSS代码里面的ul、cl就是针对class="items"的呀
.spec-scroll .items ul{position:absolute;width:999999px;height:56px;}.spec-scroll .items ul li{float:left;width:64px;text-align:center;}.spec-scroll .items ul li img{border:1px solid #CCC;padding:2px;width:50px;height:50px;}.spec-scroll .items ul li img:hover{border:2px solid #FF6600;padding:1px;}
这里只是对全局ul、cl初始化
img,ol,ul,li{margin:0;padding:0;} ol, ul{ list-style: none outside none;}

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.
