请问怎么改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 src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" jqimg="images/b1.jpg" / alt="帮忙看看怎么修改这个css代码_html/css_WEB-ITnose" ></span> </div> <!--缩图开始--> <div class="spec-scroll"> <a class="prev"><</a> <a class="next">></a> <div class="items"> <ul> <li><img src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" alt="佳能" bimg="images/b1.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s2.jpg" class="lazy" alt="佳能" bimg="images/b2.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s3.jpg" class="lazy" alt="佳能" bimg="images/b3.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" alt="佳能" bimg="images/b1.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s3.jpg" class="lazy" alt="佳能" bimg="images/b3.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" alt="佳能" bimg="images/b1.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s2.jpg" class="lazy" alt="佳能" bimg="images/b2.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" alt="佳能" bimg="images/b1.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s2.jpg" class="lazy" alt="佳能" bimg="images/b2.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s2.jpg" class="lazy" alt="佳能" bimg="images/b2.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s1.jpg" class="lazy" alt="佳能" bimg="images/b1.jpg" onmousemove="preview(this);"></li> <li><img src="/static/imghwm/default1.png" data-src="images/s2.jpg" class="lazy" alt="佳能" bimg="images/b2.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;}

HTML的作用是通過標籤和屬性定義網頁的結構和內容。 1.HTML通過到、等標籤組織內容,使其易於閱讀和理解。 2.使用語義化標籤如、等增強可訪問性和SEO。 3.優化HTML代碼可以提高網頁加載速度和用戶體驗。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代碼” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代碼”代碼“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web開發的三大支柱。 1.HTML定義網頁結構,使用標籤如、等。 2.CSS控製網頁樣式,使用選擇器和屬性如color、font-size等。 3.JavaScript實現動態效果和交互,通過事件監聽和DOM操作。

HTML定義網頁結構,CSS負責樣式和佈局,JavaScript賦予動態交互。三者在網頁開發中各司其職,共同構建豐富多彩的網站。

HTML適合初學者學習,因為它簡單易學且能快速看到成果。 1)HTML的學習曲線平緩,易於上手。 2)只需掌握基本標籤即可開始創建網頁。 3)靈活性高,可與CSS和JavaScript結合使用。 4)豐富的學習資源和現代工具支持學習過程。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。

如何設計菜單中的虛線分割效果?在設計菜單時,菜名和價格的左右對齊通常不難實現,但中間的虛線或點如何...

網頁代碼編輯器中的HTML元素分析許多在線代碼編輯器允許用戶輸入HTML、CSS和JavaScript代碼。最近,有人提出了一...


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

SublimeText3漢化版
中文版,非常好用

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

禪工作室 13.0.1
強大的PHP整合開發環境