<!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=gb2312" /> </head> <style>.shopzp{display:inline-block; width:950px; background:#2e180d; }.shopzp li { display:inline; width:100px; float:left; line-height:30px}.shopzp a { position:relative; left:-40px; display:block; text-decoration:none; background:#cccccc; width:100px; }.shopzp a span { display:block; font-weight:bold; color:#000; text-align:center; font-family:"微软雅黑";}.shopzp a em { display:none;}.shopzp a:hover { background:#FF0000;}.shopzp a:hover span { color:#fff;}</style><ul class="shopzp"> <li><a href="#"><span>全部商品</span></a></li> <li><a href="#"><span>首页</span></a></li> <li><a href="#"><span>热卖宝贝</span></a></li> <li><a href="#"><span>新品抢购</span></a></li> <li><a href="#"><span>活动专区</span></a></li> <li style="position:relative;right:-40;float:right; font-size:14px"><a href="#"><span>服务指南</span></a></li> <li style="position:relative;right:-40;float:right; font-size:14px"><a href="#"><span>收藏店铺</span></a></li></ul>
回复讨论(解决方案)
默认情况下,body,ul 等标签有margin,padding值,需要重置一下默认值。
html, body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td, tbody {list-style:none; margin:0px; padding:0px; }
在你的css加上
body{ margin:0; padding:0; font:12px/1.5 Microsoft YaHei;background:#f2f2f2}
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, img, small, strike, sub, sup, tt, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, button, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; }
input{background:none;border:none;}
ul , li { list-style:none;}
默认情况下,body,ul 等标签有margin,padding值,需要重置一下默认值。
margin,padding设置成0就行了。另外样式也设置成none
.shopzp ul{margin:0; padding:0; float:left; clear:both;}
*{margin:0;padding:0;}改变所有属性的默认样式的内外编剧都为0,就可以了~
谢谢大家了 已经解决了

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代碼。最近,有人提出了一...

關於使用react-app-rewired構建靜態頁面時如何避免代碼壓縮許多開發者在使用React構建靜態頁面時,希望在交付給�...


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

Atom編輯器mac版下載
最受歡迎的的開源編輯器

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

記事本++7.3.1
好用且免費的程式碼編輯器