搜索
首页web前端html教程史上最全的标签总结大全

史上最全的标签总结大全

Jun 16, 2017 pm 05:12 PM
大全总结标签

基本结构标签: 
,表示该文件为HTML文件 
,包含文件的标题,使用的脚本,样式定义等 
---,包含文件的标题,标题出现在浏览器标题栏中 
,的结束标志 
,放置浏览器中显示信息的所有标志和属性,其中内容在浏览器中显示. 
,的结束标志 
,的结束标志

其它主要标签,以下所有标志用在中: 
,链接标志,"…"为链接的文件地址 
,显示图片标志,"…"为图片的地址 

,换行标志 

,分段标志 
,采用黑体字 
,采用斜体字 


,水平画线 
,定义表格,HTML中重要的标志 
,定义表格的行,用在
中 
,定义表格的单元格,用在中 
,字体样式标志

属性: 
属性是用来修饰标志的,属性放在开始标志内. 
例:属性bgcolor="BLACK"表示背景色为黑色. 
引用属性的例子: 
表示页面背景色为黑色; 
表示表格背景色为黑色.

常用属性: 
对齐属性,范围属性: 
ALIGN=LEFT,左对齐(缺省值),WIDTH=象素值或百分比,对象宽度. 
ALIGN=CENTER,居中,HEIGHT=象素值或百分比,对象高度. 
ALIGN=RIGHT,右对齐. 
色彩属性: 
COLOR=#RRGGBB,前景色,参考色彩对照表. 
BGCOLOR=#RRGGBB,背景色.

表示绝对居中.

表格标识的开始和结束. 
属性: 
cellpadding=数值单位是像素,定义表元内距 
cellspacing=数值单位是像素,定义表元间距 
border=数值单位是像素,定义表格边框宽度 
width=数值单位是像素或窗口百分比,定义表格宽度 
background=图片链接地址,定义表格背景图 
表格中一个表格行的开始和结束; 
表格中行内一个单元格的开始和结束 
属性: 
Colspan="",单元格跨越多列; 
Rowspan="",单元格跨越多行; 
Width="";定义表格宽度 
Height="";定义表格高度 
Align="";对齐方式 
Valign=""; 
Border="",边框宽度; 
Bgcolor="",背景色; 
Bordercolor="",边框颜色; 
Bordercolorlight="",边框明亮面的颜色; 
Bordercolordark="",边框暗淡面的颜色; 
Cellpadding="",内容与边框的距离(默认为2); 
Cellspacing="",单元格间的距离(默认为2);


强制换行 
文本标识的开始和结束 
属性: 
face=字体 
color=颜色 
加粗文字标识的开始和结束 
属性: 
style=font-size:40pt;,用样式表方式控制字体大小,这里是40点 

,分区标识的开始和结束 
属性: 
align=|center|left|right|水平对齐方式 
动态标识的开始和结束,如标识内放置贴图格式则可实现图片滚动 
属性: 
scrollamount=1~60,滚动速度 
direction=|left|right|up|down|,滚动方向 
scrolldelay=滚动延时,单位:毫秒 

段落标识, 
 空格符, 
贴图标识 
属性: 
src=../../图片链接地址,贴图标识必备属性 
style=filter:Alpha(opacity=100,style=2); 
filter:样式表滤镜; 
Alpha:透明滤镜, 
opacity:不透明度100(0~100); 
style:样式2(0~3), 
rules="none"不显示内框" 
多媒体文件标识 
属性: 
SRC="../../FILENAME", 
设定音乐文件的路径,文件类型除了可以播放.rm;.mp3;.wav等音频,还可播放.swf和.mov等视频. 
AUTOSTART=TRUE/FALSE, 
是否要音乐文件传送完就自动播放,TRUE是要,FALSE是不要,默认为FALSE 
LOOP=,设定播放重复次数,LOOP=6表示重复6次,true或-1为无限循环,false为播放一次即停止. 
STARTIME="分:秒", 
设定乐曲的开始播放时间,如20秒后播放写为STARTIME=00:20 
VOLUME=0-100, 
设定音量的大小.如果没设定的话,就用系统的音量. 
WIDTH,HEIGHT, 
设定控制面板的大小,都设为0可隐藏播放器 
HIDDEN=TRUE, 
隐藏控制面板 
CONTROLS=CONSOLE/SMALLCONSOLE, 
设定控制面板的样子, 
,背景音乐标识,只能用于.wav和.mp3格式. 
属性: 
LOOP=,设定播放重复次数,LOOP=6表示重复6次,true或-1为无限循环,false为播放一次即停止.

表单标签: 

表格标识的开始和结束,表单的内容都放在这里. 
下边的标签放在表单内: 
 
属性: 
Multiple,多选 
,大量文字输入的编辑块 
属性: 
Cols="",行; 
Rows="",列; 
,文本框 
,密码框 
,提交按扭 
,复选框 
,单选框 
,重置按扭 
,图片按扭 
,隐藏域 
,按扭 
,浏览文件 
公共属性: 
Name=""; 
Value="" 
Size=""

框架标签: 
...,定义框架. 
,放在框架标签内,定义每个框架的内容. 
属性: 
Cols="" 
Rows="" 
Frameborder="" 
Framespacing="" 
src="" 
Scrolling="",滚动条(No,Yes); 
Noresize,框加大小不可变; 
Marginhight="",高度空余空间; 
Marginwidth="",宽度空余空间; 
Target="",目标框架.

其他标签: 
,背景音乐; 
Src="" 
Loop="",循环次数; 
,媒体播放块; 
Src="" 
Loop="",循环次数; 
,滚动部分; 
属性: 
Bgcolor="" 
Behavior,设置或获取文本如何在字幕中滚动. 
Direction="",滚动方向; 
Height="" 
Width="" 
Loop="",环次数; 
scrollAmount="",设置或获取介于每个字幕绘制序列之间的文本滚动像素数. 
scrollDelay="",设置或获取字幕滚动的速度. 
scrollHeight="",获取对象的滚动高度; 
scrollLeft="",设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离. 
scrollTop="",设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离. 
trueSpeed="",设置或获取字幕的位置是否使用scrollDelay和scrollAmount属性计算,已过的实际时间来自于时钟计时.

,注释标记,在""之间的内容将不在浏览器中显示.

--

基本标签: 
,创建一个HTML文档
,设置文档标题和其它在网页中不显示的信息; 
,设置文档的标题; 

,最大的标题; 
,预先格式化文本; 
,下划线 
,黑体字; 
,斜体字; 
,打字机风格的字体; 
,引用,通常是斜体; 
,强调文本(通常是斜体加黑体); 
,加重文本(通常是斜体加黑体); 
,设置字体大小从1到7,颜色使用名字或RGB的十六进制值; 
,基准字体标记; 
,字体加大; 
,字体缩小; 
,加删除线; 
,程式码; 
,键盘字; 
,范例; 
,变量; 
,向右缩排; 
,述语定义; 
,地址标记; 
,上标字; 
,下标字; 
...固定宽度字体(在文件中空白、换行、定位功能有效) 
...</plaintext>固定宽度字体(不执行标记符号); <br><listing>...</listing>,固定宽度小字体; <br><font,color=00ff00>...</font>字体颜色; <br><font,size=1>...</font>最小字体; <br><font,style,=&#39;font-size:100,px&#39;>...</font>无限增大.</p> <p>格式标签:</p> <p><p></p>,创建一个段落; <br><p,align="">,将段落按左、中、右对齐; <br><br>,换行,插入一个回车换行符; <br><blockquote></blockquote>,从两边缩进文本;</p> <p><dl></dl>,列表标签,定义列表; <br><dt>,定义列表标题; <br><dd>,定义列表内容; <br>例: <br><dl> <br><dt>标题1</dt> <br><dd>内容11</dd> <br><dd>内容12</dd> <br><dt>标题2</dt> <br><dd>内容21</dd> <br><dd>内容22</dd> <br></dl></p> <p><ol></ol>,列表标签,定义一个标有数字的列表;</p> <p><ul></ul>,列表标签,定义一个标有圆点的列表; <br><li>,放在每个列表项之前; <br>放在<ol></ol>之间则每个列表项加上一个数字,放在<ul></ul>之间则每个列表项加上一个圆点;</p> <p><div,align=""></div>,分区标签,用来排版大块HTML段落,也用于格式化表; <br><MENU>,选项清单; <br><DIR>,目录清单; <br><nobr></nobr>,强行不换行; <br><hr,size=&#39;9&#39;,width=&#39;80%&#39;,color=&#39;ff0000&#39;>水平线(设定宽度); <br><center></center>,水平居中.</p> <p>链接标签: <br><a,href="URL"></a>,创建超文本链接; <br><a,href="mailtEMAIL"> <br></a>,创建自动发送电子邮件的链接; <br><a,name="name"></a>,创建位于文档内部的书签; <br><a,href="#name"></a>,创建指向位于文档内部书签的链接; <br><BASE>,文档中不能被该站点辨识的其它所有链接源的URL; <br><LINK>,定义一个链接和源之间的相互关系;</p> <p>链接标签注解: <br>target="...",决定链接源在什么地方显示(用户自定义的名字,_blank,_parent,_self,_top); <br>rel="...",发送链接的类型; <br>rev="...",保存链接的类型; <br>accesskey="...",指定该元素的热键; <br>shape="...",允许我们使用已定义的形状定义客户端的图形镜像(default,rect,circle,poly); <br>coord="...",使用像素或者长度百分比来定义形状的尺寸; <br>tabindex="...",使用定义过的tabindex元素设置在各个元素之间的焦点获取顺序(使用tab键使元素获得焦点).</p> <p>表格标签: <br><table></table>,创建一个表格; <br><tr></tr>,表格中的每一行; <br><td></td>,表格中一行中的每一个格子; <br><th></th>,设置表格头:通常是黑体居中文字; <br><table,cellspacing="">,设置表格格子之间空间的大小; <br><table,border="">,设置边框的宽度; <br><table,cellpadding="">,设置表格格子边框与其内部内容之间空间的大小; <br><table,width="">,设置表格的宽度.用绝对像素值或总宽度的百分比; <br><table,align="">,设置表格格子的水平对齐方式(left,center,right,justify); <br><tr,align="">,设置表格格子的水平对齐方式(left,center,right,justify); <br><tr,valign="">,设置表格格子的垂直对齐方式(baseline,bottom,middle,top); <br><td,colspan="">,设置一个表格格子跨占的列数(缺省值为1); <br><td,rowspan="">,设置一个表格格子跨占的行数(缺省值为1); <br><td,nowrap>,禁止表格格子内的内容自动断行; <br><CAPTION></CAPTION>,表格的标题; <br><COLGROUP></COLGROUP>,定义多个列为一组列; <br><TABLE></TABLE>,创建一个表格; <br><THEAD></THEAD>,定义表格的页眉; <br><COL>,定义一个列组中的列,以便对它们能够同时设置有关属性; <br><TBODY></TBODY>,定义一个表格的实体; <br><TFOOT></TFOOT>,定义一个表格的页脚;</p> <p>表单标签: <br><form></form>,创建表单; <br>action="...",接收数据的服务器的URL; <br>method="...",HTTP的方法(get,,post),其中get是被反对使用的; <br>enctype="...",指定MIME(Internet媒体类型); <br>onsubmit="...",当提交表单时发生的内部事件; <br>noreset="...",在重新设置表单时发生的内部事件; <br>target="...",决定把内容显示在什么地方(_blank,_parent,_self,_top) <br><select,multiple,name="name",size=""></select>,创建滚动菜单,size设置在需要滚动前可以看到的表单项数目; <br><option>,设置每个表单项的内容; <br><select,name="name"></select>,创建<a href="http://www.php.cn/code/6140.html" target="_blank">下拉菜单</a>; <br><pre ,name="name",cols=40,rows=8></pre>,创建一个文本框区域,列的数目设置宽度,行的数目设置高度; <br><input,type="checkbox",name="name">,创建一个复选框,文字在标签后面; <br><input,type="radio",name="name",value="">,创建一个单选框,文字在标志后面; <br><input,type=text,name="foo",size=20>,创建一个单行文本输入区域,size设置以字符串的宽度; <br><input,type="submit",value="name">,创建提交(submit)按钮; <br><input,type="image",border=0,name="name",src="name.gif">,创建一个使用图象的提交(submit)按钮; <br><input,type="reset">,创建重置(reset)按钮; <br><BUTTON></BUTTON>,创建一个按钮; <br>disabled="...",把按钮的状态设置为不能; <br>name="...",按钮的控制名,value="...",按钮的值; <br>type="...",按钮的类型(button,,submit,,reset); <br><FIELDSET></FIELDSET>,把相互关联的控件组合成一组; <br><ISINDEX>,提示用户输入; <br><LABEL></LABEL>,为一个控件提供标签; <br><LEGEND></LEGEND>,为FIELDSET元素指定一标题; <br><SELECT></SELECT>,为用户做选择创建各个选项; <br><TEXTAREA></TEXTAREA>,创建一个允许用户多行输入的区域.</p> <p>表单标签注解: <br>type="...",用于输入控件的类型(text,password,checkbox,radio,submit,reset,file,hidden,image,button); <br>name="...",控件的控制名(要求是除了submit和reset之外的任何名字); <br>value="...",控件的初始值; <br>checked="...",把一个单选钮设置为选中的状态; <br>disabled="...",把控件的状态设置为不能使用; <br>readonly="...",只对输入密码的文本框使用; <br>size="...",表示以像素为单位的除了文本框和密码框控件之外的其它控件的宽度,它是用来指定字符的数目; <br>src="...",一个图像控件的URL; <br>maxlength="...",指定可以输入的最多的字符数目; <br>alt="...",另外一种文本描述; <br>usemap="...",到客户端图形镜像的URL; <br>align="...",被反对.控制对齐方式(left,,center,,right,,justify); <br>tabindex="...",通过定义的tabindex值确定在不同元素之间获得焦点的顺序; <br>onfocus="...",当元素获得焦点时发生的事件; <br>onblur="...",当元素失去焦点时发生的事件; <br>onselect="...",当元素被选中时发生的事件; <br>onchang="...",当元素状态被改变时发生的事件; <br>accept="...",允许上载的文件类型.</p> <p>帧标签(框架标签): <br><frameset></frameset>,放在一个帧文档的<body>标签之前,也可以嵌在其他帧文档中; <br><frameset,rows="value,value">,定义一个帧内的行数,可用像素值或高度百分比; <br><frameset,cols="value,value">,定义一个帧内的列数,可用像素值或宽度百分比; <br><frame>,定义一个帧内的单一窗或窗区域; <br><noframes></noframes>,定义在不支持帧的浏览器中显示什么提示; <br><frame,src="URL">,规定帧内显示的HTML文档; <br><frame,name="name">,命名帧或区域以便别的帧可以指向它; <br><frame,marginwidth="">,定义帧左右边缘的空白大小,必须大于等于1; <br><frame,marginheight="">,定义帧上下边缘的空白大小,必须大于等于1; <br><frame,scrolling="">,设置帧是否有滚动栏,其值可以是"yes","no",或"auto"; <br><frame,noresize>,禁止用户调整一个帧的大小; <br><IFRAME></IFRAME>,创建一个内联的帧; <br>scr="...",定义在帧中显示的内容的来源; <br>frameborder="...",定义帧之间的边界(0或1); <br>align="...",被反对,控制对齐方式(left,,center,,right,,justify); <br>height="...",帧的高度,width="..."帧的宽度; <br><marquee>...</marquee>,普通卷动; <br><marquee,behavior=slide>...</marquee>,滑动; <br><marquee,behavior=scroll>...</marquee>,预设卷动; <br><marquee,behavior=alternate>...</marquee>,来回卷动; <br><marquee,direction=down>...</marquee>,向下卷动; <br><marquee,direction=up>...</marquee>,向上卷动; <br><marquee,direction=right></marquee>,向右卷动; <br><marquee,direction=&#39;left&#39;></marquee>,向左卷动; <br><marquee,loop=2>...</marquee>,卷动次数; <br><marquee,width=180>...</marquee>,设定宽度; <br><marquee,height=30>...</marquee>,设定高度; <br><marquee,bgcolor=FF0000>...</marquee>,设定背景颜色; <br><marquee,scrollamount=30>...</marquee>,设定卷动距离; <br><marquee,scrolldelay=300>...</marquee>,设定卷动时间; <br><img,src="">,插入图片,参数有:width="宽",alt="说明文字",height="高",boder="边框".</p> <p>文档整体属性标签: <br><body,bgcolor="">,设置背景颜色.使用名字或RGB的十六进制值; <br><body,background="">,设置背景图片; <br><body,bgsound="">,设置背景音乐; <br><body,bgproperties="fixed">,固定背景图片(IE适用); <br><body,text="">,设置文本颜色.使用名字或RGB的十六进制值; <br><body,link="">,设置链接颜色.使用名,字或RGB的十六进制值; <br><body,vlink="">,设置已使用的链接的颜色.使用名字或RGB的十六进制值; <br><body,alink="">,设置正在被击中的链接的颜色.使用名字或RGB的十六进制值; <br><body,topmargin="">,设置页面的上边距; <br><body,leftmargin="">,设置页面的左边距.</p> <p><br></p><p>以上是史上最全的标签总结大全的详细内容。更多信息请关注PHP中文网其他相关文章!</p></div><div class="wzconShengming_sp"><div class="bzsmdiv_sp">声明</div><div>本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</div></div></div><div class="phpgenera_Details_mainL4"><div class="phpmain1_2_top"><a href="javascript:void(0);" class="phpmain1_2_top_title">相关文章<img class="lazy" data-src="/static/imghwm/index2_title2.png" src="/static/imghw/default1.png" alt="" /></a></div><div class="phpgenera_Details_mainL4_info"><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796794180.html" title="HTML的角色:构建Web内容" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174430155217186.jpg?x-oss-process=image/resize,p_40" alt="HTML的角色:构建Web内容" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796794180.html" title="HTML的角色:构建Web内容" class="phphistorical_Version2_mids_title">HTML的角色:构建Web内容</a><span class="Articlelist_txts_time">Apr 11, 2025 am 12:12 AM</span><p class="Articlelist_txts_p">HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796793634.html" title="HTML和代码:仔细观察术语" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174424853215422.jpg?x-oss-process=image/resize,p_40" alt="HTML和代码:仔细观察术语" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796793634.html" title="HTML和代码:仔细观察术语" class="phphistorical_Version2_mids_title">HTML和代码:仔细观察术语</a><span class="Articlelist_txts_time">Apr 10, 2025 am 09:28 AM</span><p class="Articlelist_txts_p">htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代码” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代码”代码“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796793129.html" title="HTML,CSS和JavaScript:Web开发人员的基本工具" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174412873346901.jpg?x-oss-process=image/resize,p_40" alt="HTML,CSS和JavaScript:Web开发人员的基本工具" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796793129.html" title="HTML,CSS和JavaScript:Web开发人员的基本工具" class="phphistorical_Version2_mids_title">HTML,CSS和JavaScript:Web开发人员的基本工具</a><span class="Articlelist_txts_time">Apr 09, 2025 am 12:12 AM</span><p class="Articlelist_txts_p">HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796792987.html" title="HTML,CSS和JavaScript的角色:核心职责" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174411031220217.jpg?x-oss-process=image/resize,p_40" alt="HTML,CSS和JavaScript的角色:核心职责" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796792987.html" title="HTML,CSS和JavaScript的角色:核心职责" class="phphistorical_Version2_mids_title">HTML,CSS和JavaScript的角色:核心职责</a><span class="Articlelist_txts_time">Apr 08, 2025 pm 07:05 PM</span><p class="Articlelist_txts_p">HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796791823.html" title="HTML容易为初学者学习吗?" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174395586298618.jpg?x-oss-process=image/resize,p_40" alt="HTML容易为初学者学习吗?" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796791823.html" title="HTML容易为初学者学习吗?" class="phphistorical_Version2_mids_title">HTML容易为初学者学习吗?</a><span class="Articlelist_txts_time">Apr 07, 2025 am 12:11 AM</span><p class="Articlelist_txts_p">HTML适合初学者学习,因为它简单易学且能快速看到成果。1)HTML的学习曲线平缓,易于上手。2)只需掌握基本标签即可开始创建网页。3)灵活性高,可与CSS和JavaScript结合使用。4)丰富的学习资源和现代工具支持学习过程。</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796791144.html" title="HTML中起始标签的示例是什么?" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174386905283883.jpg?x-oss-process=image/resize,p_40" alt="HTML中起始标签的示例是什么?" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796791144.html" title="HTML中起始标签的示例是什么?" class="phphistorical_Version2_mids_title">HTML中起始标签的示例是什么?</a><span class="Articlelist_txts_time">Apr 06, 2025 am 12:04 AM</span><p class="Articlelist_txts_p">AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796790923.html" title="如何利用CSS的Flexbox布局实现菜单中虚线分割效果的居中对齐?" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174286321766559.jpg?x-oss-process=image/resize,p_40" alt="如何利用CSS的Flexbox布局实现菜单中虚线分割效果的居中对齐?" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796790923.html" title="如何利用CSS的Flexbox布局实现菜单中虚线分割效果的居中对齐?" class="phphistorical_Version2_mids_title">如何利用CSS的Flexbox布局实现菜单中虚线分割效果的居中对齐?</a><span class="Articlelist_txts_time">Apr 05, 2025 pm 01:24 PM</span><p class="Articlelist_txts_p">如何设计菜单中的虚线分割效果?在设计菜单时,菜名和价格的左右对齐通常不难实现,但中间的虚线或点如何...</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/zh/faq/1796790922.html" title="在线代码编辑器究竟用什么HTML元素实现代码输入?" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174286344479419.jpg?x-oss-process=image/resize,p_40" alt="在线代码编辑器究竟用什么HTML元素实现代码输入?" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/zh/faq/1796790922.html" title="在线代码编辑器究竟用什么HTML元素实现代码输入?" class="phphistorical_Version2_mids_title">在线代码编辑器究竟用什么HTML元素实现代码输入?</a><span class="Articlelist_txts_time">Apr 05, 2025 pm 01:21 PM</span><p class="Articlelist_txts_p">网页代码编辑器中的HTML元素分析许多在线代码编辑器允许用户输入HTML、CSS和JavaScript代码。最近,有人提出了一...</p></div></div><a href="https://m.php.cn/zh/web-designer.html" class="phpgenera_Details_mainL4_botton"><span>See all articles</span><img class="lazy" data-src="/static/imghwm/down_right.png" src="/static/imghw/default1.png" alt="" /></a></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><div class="AI_ToolDetails_main4sR"><div class="phpgenera_Details_mainR3"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>热AI工具</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/ai/undresserai-undress" title="Undresser.AI Undress"class="phpmain_tab2_mids_title"><h3>Undresser.AI Undress</h3></a><p>人工智能驱动的应用程序,用于创建逼真的裸体照片</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/ai/ai-clothes-remover" title="AI Clothes Remover"class="phpmain_tab2_mids_title"><h3>AI Clothes Remover</h3></a><p>用于从照片中去除衣服的在线人工智能工具。</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/ai/undress-ai-tool" title="Undress AI Tool"class="phpmain_tab2_mids_title"><h3>Undress AI Tool</h3></a><p>免费脱衣服图片</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/ai/clothoffio" title="Clothoff.io"class="phpmain_tab2_mids_title"><h3>Clothoff.io</h3></a><p>AI脱衣机</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/ai/ai-hentai-generator" title="AI Hentai Generator"class="phpmain_tab2_mids_title"><h3>AI Hentai Generator</h3></a><p>免费生成ai无尽的。</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/zh/ai">显示更多</a></div></div></div><div class="phpgenera_Details_mainR4"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>热门文章</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/1796780570.html" title="R.E.P.O.能量晶体解释及其做什么(黄色晶体)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.能量晶体解释及其做什么(黄色晶体)</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 周前</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/1796780641.html" title="R.E.P.O.最佳图形设置" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最佳图形设置</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 周前</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/1796785841.html" title="刺客信条阴影:贝壳谜语解决方案" class="phpgenera_Details_mainR4_bottom_title">刺客信条阴影:贝壳谜语解决方案</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>2 周前</span><span>ByDDD</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/1796780520.html" title="R.E.P.O.如果您听不到任何人,如何修复音频" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.如果您听不到任何人,如何修复音频</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 周前</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/1796779766.html" title="WWE 2K25:如何解锁Myrise中的所有内容" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:如何解锁Myrise中的所有内容</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 周前</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/zh/article.html">显示更多</a></div></div></div><div class="phpgenera_Details_mainR3"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>热工具</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/toolset/development-tools/660" title="Atom编辑器mac版下载" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ed8cfa94c1a582.jpg" src="/static/imghw/default1.png" alt="Atom编辑器mac版下载" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/toolset/development-tools/660" title="Atom编辑器mac版下载" class="phpmain_tab2_mids_title"><h3>Atom编辑器mac版下载</h3></a><p>最流行的的开源编辑器</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/003/169206948656118.png" src="/static/imghw/default1.png" alt="mPDF" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_title"><h3>mPDF</h3></a><p>mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/toolset/development-tools/1556" title="螳螂BT" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/004/169206588591843.png" src="/static/imghw/default1.png" alt="螳螂BT" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/toolset/development-tools/1556" title="螳螂BT" class="phpmain_tab2_mids_title"><h3>螳螂BT</h3></a><p>Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/toolset/development-tools/505" title="Dreamweaver Mac版" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d36dab93a95387.png" src="/static/imghw/default1.png" alt="Dreamweaver Mac版" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/toolset/development-tools/505" title="Dreamweaver Mac版" class="phpmain_tab2_mids_title"><h3>Dreamweaver Mac版</h3></a><p>视觉化网页开发工具</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/zh/toolset/development-tools/92" title="记事本++7.3.1" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg" src="/static/imghw/default1.png" alt="记事本++7.3.1" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/zh/toolset/development-tools/92" title="记事本++7.3.1" class="phpmain_tab2_mids_title"><h3>记事本++7.3.1</h3></a><p>好用且免费的代码编辑器</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/zh/ai">显示更多</a></div></div></div><div class="phpgenera_Details_mainR4"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>热门话题</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/gmailyxdlrkzn" title="gmail邮箱登陆入口在哪里" class="phpgenera_Details_mainR4_bottom_title">gmail邮箱登陆入口在哪里</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>7461</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>15</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/cakephp-tutor" title="CakePHP 教程" class="phpgenera_Details_mainR4_bottom_title">CakePHP 教程</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1376</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>52</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/faq/steamdzhmcssmgs" title="steam的账户名称是什么格式" class="phpgenera_Details_mainR4_bottom_title">steam的账户名称是什么格式</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>77</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>11</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/winactivationkeyper" title="win11激活密钥永久" class="phpgenera_Details_mainR4_bottom_title">win11激活密钥永久</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>44</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>19</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/zh/faq/newyorktimesdailybrief" title="NYT连接提示和答案" class="phpgenera_Details_mainR4_bottom_title">NYT连接提示和答案</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>17</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>17</span></div></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/zh/faq/zt">显示更多</a></div></div></div></div></main><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><footer><div class="footer"><div class="footertop"><img src="/static/imghwm/logo.png" alt=""><p>公益在线PHP培训,帮助PHP学习者快速成长!</p></div><div class="footermid"><a href="https://m.php.cn/zh/about/us.html">关于我们</a><a href="https://m.php.cn/zh/about/disclaimer.html">免责声明</a><a href="https://m.php.cn/zh/update/article_0_1.html">Sitemap</a></div><div class="footerbottom"><p> © php.cn All rights reserved </p></div></div></footer><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '9']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><script> jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script><script>// 通用函数,用于显示或隐藏元素 function toggleElementsDisplay(className, show) { const elements = document.getElementsByClassName(className); for (let i = 0; i < elements.length; i++) { elements[i].style.display = show ? "block" : "none"; } } // 页面加载完成后执行的主函数 document.addEventListener("DOMContentLoaded", () => { // 1. 绑定菜单按钮事件 const bindMenuEvents = () => { const toggleDisplay = (className, show, eventId) => { const element = document.getElementById(eventId); if (element) { element.addEventListener("click", (event) => { event.preventDefault(); toggleElementsDisplay(className, show); }); } }; toggleDisplay("m_editormain12main", true, "fixed_tab_img"); toggleDisplay("m_editormain12main", false, "fixed_tab_topi"); toggleDisplay("m_editormain12main", false, "fixed_tab_close"); toggleDisplay("m_menu", true, "lan1sp"); toggleDisplay("m_menu", false, "m_editormain12main_topi_sp"); toggleDisplay("m_menu_lang", true, "lan1"); toggleDisplay("m_menu_lang", false, "m_editormain12main_topi_lan"); }; // 2. 绑定滚动链接事件 const bindScrollLinks = () => { const titleList = document.getElementById("fixed_tab_titlelist"); const menuMain = document.getElementsByClassName("m_editormain12main")[0]; const links = document.querySelectorAll('.fixed_tab_a'); links.forEach(linkElement => { if (linkElement) { linkElement.addEventListener("click", async (e) => { e.preventDefault(); e.stopPropagation(); // 先隐藏菜单 if (menuMain) menuMain.style.display = "none"; if (titleList) titleList.style.display = "none"; // 获取目标元素的 ID const targetId = linkElement.getAttribute('href').substring(1); const targetElement = document.getElementById(targetId); // 等待 DOM 更新 await new Promise(resolve => requestAnimationFrame(resolve)); // 滚动到目标位置 if (targetElement) { targetElement.scrollIntoView({ behavior: "smooth", block: "start" }); } }); } }); }; // 3. 绑定关闭按钮事件 const bindCloseButton = () => { const closeButton = document.querySelector(".phpgenera_Details_mainR1_close"); const container = document.querySelector(".phpgenera_Details_mainR1"); if (closeButton && container) { closeButton.addEventListener("click", (event) => { event.preventDefault(); container.style.display = "none"; }); } }; // 4. 初始化菜单交互功能 const initMenuInteraction = () => { const menuGroupElements = document.querySelectorAll('.layui-menu-item-group'); menuGroupElements.forEach(menuItem => { menuItem.addEventListener('click', function(event) { if (event.target.closest('.m_menusnames')) { return; } this.classList.toggle('layui-menu-item-down'); this.classList.toggle('layui-menu-item-up'); const subMenuContainer = this.querySelector('.m_menusnames'); const icon = this.querySelector('.layui-icon'); if (subMenuContainer && icon) { if (this.classList.contains('layui-menu-item-down')) { subMenuContainer.style.display = 'block'; icon.classList.remove('layui-icon-down'); icon.classList.add('layui-icon-up'); } else { subMenuContainer.style.display = 'none'; icon.classList.remove('layui-icon-up'); icon.classList.add('layui-icon-down'); } } }); }); }; // 5. 初始化 layui 功能 const initLayui = () => { if (typeof layui !== 'undefined') { layui.use(function () { var util = layui.util; if (util && util.fixbar) { util.fixbar({ on: { mouseenter: function (type) { if (layer && layer.tips) { layer.tips(type, this, { tips: 4, fixed: true, }); } }, mouseleave: function (type) { if (layer && layer.closeAll) { layer.closeAll("tips"); } }, }, }); } }); } }; // 执行所有初始化函数 bindMenuEvents(); bindScrollLinks(); bindCloseButton(); initMenuInteraction(); initLayui(); }); </script></body></html>