点击一级目录中的“用户管理”,展开二级目录,发现二级目录最后一项与“系统管理”之间有一大截距离,请问这是怎么回事?如同:
附上HTML代码
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type=text/css>#baseInfoManager{ width:180px; height:100px; }#baseInfoManager p{ height:30px; text-indent:20px; }#baseInfoManager p a{ display:block; height:100%; width:100%; text-decoration:none; line-height:30px; font-family:Arial, Helvetica, sans-serif; font-size:12px;}#baseInfoManager p a:hover{ height:100%; width:100%; color:#000; text-decoration:none; background:#dce7f0;}#baseInfoManager ul{ margin-top:1px; width:100%; height:100%;}#baseInfoManager ul li{ width:180px; height:30px; list-style:none; line-height:30px; text-indent:40px; }#baseInfoManager ul li a{ float:left; width:180px; height:30px; text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12px; }#baseInfoManager ul li a:hover{ width:180px; height:30px; color:#000; text-decoration:none; background:#dce7f0;}</style><SCRIPT language="javascript"> window.onload=function() { var obtn=document.getElementById('btn'); var oul=document.getElementById('ul1'); obtn.onclick=function() { if(oul.style.display=='block') { oul.style.display='none'; } else { oul.style.display='block'; } } };</SCRIPT></head><body bgcolor="#f3f8fc"> <div id="baseInfoManager"> <p id="btn"><a href="#" onClick="showSubMenu(1)">用户管理</a></p> <ul id="ul1" style="display:none;"> <li><a href="#" >aaa</a></li> <li><a href="#" >bbb</a></li> </ul> <p id="btn1"><a href="#" onClick="showSubMenu(2)">系统管理</a></p> <ul id="ul2" style="display:none;"> <li>ccc </li> <li>ddd </li> </ul> </div> </body></html>
回复讨论(解决方案)
margin
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type=text/css> *{margin: 0px;padding:0px;}#baseInfoManager{ width:180px; height:100px; }#baseInfoManager p{ height:30px; text-indent:20px; clear:both;}#baseInfoManager p a{ display:block; height:100%; width:100%; text-decoration:none; line-height:30px; font-family:Arial, Helvetica, sans-serif; font-size:12px;}#baseInfoManager p a:hover{ height:100%; width:100%; color:#000; text-decoration:none; background:#dce7f0;} #baseInfoManager ul{ margin-top:1px; width:100%;}#baseInfoManager ul li{ width:180px; list-style:none; line-height:30px; text-indent:40px; }#baseInfoManager ul li a{ float:left; width:180px; text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12px; }#baseInfoManager ul li a:hover{ width:180px; color:#000; text-decoration:none; background:#dce7f0;}</style><SCRIPT language="javascript"> window.onload=function() { var obtn=document.getElementById('btn'); var oul=document.getElementById('ul1'); obtn.onclick=function() { if(oul.style.display=='block') { oul.style.display='none'; } else { oul.style.display='block'; } } };</SCRIPT></head> <body bgcolor="#f3f8fc"> <div id="baseInfoManager"> <p id="btn"><a href="#" onClick="showSubMenu(1)">用户管理</a></p> <ul id="ul1" style="display:none;"> <li><a href="#" >aaa</a></li> <li><a href="#" >bbb</a></li> </ul> <p id="btn1"><a href="#" onClick="showSubMenu(2)">系统管理</a></p> <ul id="ul2" style="display:none;"> <li>ccc </li> <li>ddd </li> </ul> </div> </body></html>
margin
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type=text/css> *{margin: 0px;padding:0px;}#baseInfoManager{ width:180px; height:100px; }#baseInfoManager p{ height:30px; text-indent:20px; clear:both;}#baseInfoManager p a{ display:block; height:100%; width:100%; text-decoration:none; line-height:30px; font-family:Arial, Helvetica, sans-serif; font-size:12px;}#baseInfoManager p a:hover{ height:100%; width:100%; color:#000; text-decoration:none; background:#dce7f0;} #baseInfoManager ul{ margin-top:1px; width:100%;}#baseInfoManager ul li{ width:180px; list-style:none; line-height:30px; text-indent:40px; }#baseInfoManager ul li a{ float:left; width:180px; text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12px; }#baseInfoManager ul li a:hover{ width:180px; color:#000; text-decoration:none; background:#dce7f0;}</style><SCRIPT language="javascript"> window.onload=function() { var obtn=document.getElementById('btn'); var oul=document.getElementById('ul1'); obtn.onclick=function() { if(oul.style.display=='block') { oul.style.display='none'; } else { oul.style.display='block'; } } };</SCRIPT></head> <body bgcolor="#f3f8fc"> <div id="baseInfoManager"> <p id="btn"><a href="#" onClick="showSubMenu(1)">用户管理</a></p> <ul id="ul1" style="display:none;"> <li><a href="#" >aaa</a></li> <li><a href="#" >bbb</a></li> </ul> <p id="btn1"><a href="#" onClick="showSubMenu(2)">系统管理</a></p> <ul id="ul2" style="display:none;"> <li>ccc </li> <li>ddd </li> </ul> </div> </body></html>
谢谢!

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

HTML的未来将朝着更加语义化、功能化和模块化的方向发展。1)语义化将使标签更明确地描述内容,提升SEO和无障碍访问。2)功能化将引入新元素和属性,满足用户需求。3)模块化将支持组件化开发,提高代码复用性。

htmlattributesarecrucialinwebdevelopment forcontrollingBehavior,外观和功能

alt属性是HTML中标签的重要部分,用于提供图片的替代文本。1.当图片无法加载时,alt属性中的文本会显示,提升用户体验。2.屏幕阅读器使用alt属性帮助视障用户理解图片内容。3.搜索引擎索引alt属性中的文本,提高网页的SEO排名。

HTML、CSS和JavaScript在网页开发中的作用分别是:1.HTML用于构建网页结构;2.CSS用于美化网页外观;3.JavaScript用于实现动态交互。通过标签、样式和脚本,这三者共同构筑了现代网页的核心功能。

设置标签的lang属性是优化网页可访问性和SEO的关键步骤。1)在标签中设置lang属性,如。2)在多语言内容中,为不同语言部分设置lang属性,如。3)使用符合ISO639-1标准的语言代码,如"en"、"fr"、"zh"等。正确设置lang属性可以提高网页的可访问性和搜索引擎排名。

htmlattributeseresene forenhancingwebelements'functionalityandAppearance.TheyAdDinformationTodeFineBehavior,外观和互动,使网站互动,响应式,visalalyAppealing.AttributesLikutesLikeSlikEslikesrc,href,href,href,类,类型,类型,和dissabledtransfransformformformformformformformformformformformformformformforment

toCreateAlistinHtml,useforforunordedlistsandfororderedlists:1)forunorderedlists,wrapitemsinanduseforeachItem,RenderingeringAsabulleTedList.2)fororderedlists,useandfornumberedlists,useandfornumberedlists,casundfornumberedlists,customeizableWithTheTtheTthetTheTeTeptTributeFordTributeForderForderForderFerentNumberingSnumberingStyls。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

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

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)