


Regarding the code displayed in the roller skating news, the effect cannot be produced after I modified it. What's going on? _html/css_WEB-ITnose
社区导航
河南
山东
湖南
广东
江苏
四川
陕西
宁夏
云南
海南
台湾
浙江
吉林
黑龙江
北京
重庆
澳门
河北
山西
湖北
广西
江西
安徽
甘肃
青海
贵州
福建
西藏
新疆
辽宁
内蒙古
上海
天津
香港
郑州
安阳
南阳
信阳
洛阳
濮阳
开封
漯河
许昌
周口
新乡
周口
郑州
安阳
南阳
信阳
洛阳
郑州
安阳
南阳
郑州
安阳
南阳
新乡
周口
郑州
新乡
周口
郑州
新乡
周口
郑州
新乡
周口
郑州
周口
郑州
新乡
周口
郑州
周口
郑州
新乡
周口
郑州
新乡
周口
郑州
新乡
周口
郑州
新乡
周口
郑州
安阳
新乡
周口
郑州
安阳
新乡
周口
<SCRIPT> <br> var Tags=document.getElementById('NewsTop_tit').getElementsByTagName('p'); <br> var TagsCnt=document.getElementById('NewsTop_cnt').getElementsByTagName('span'); <br> var len=Tags.length; <br> var flag=1;//修改默认值 <br> for(i=1;i<len;i++){ <br /> Tags[i].value = i; <br /> Tags[i].onmouseover=function(){changeNav(this.value)}; <br /> TagsCnt[i].className='undis'; <br /> } <br /> Tags[flag].className='topC1'; <br /> TagsCnt[flag].className='dis'; <br /> function changeNav(v){ <br /> Tags[flag].className='topC0'; <br /> TagsCnt[flag].className='undis'; <br /> flag=v; <br /> Tags[v].className='topC1'; <br /> TagsCnt[v].className='dis'; <br /> } <br /> </SCRIPT>
回复讨论(解决方案)
运行的时候,显示页面有错误,而且只出现一遍,鼠标到头再返回去就不会出现效果了
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
标签没有问题吧
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
+1
不好意思,理解错误。。。
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
++
引用 2 楼 的回复:
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
+1
还有一个问题,需要请教,怎么实现让上面两行之间的间距变的小点呢,就是河南河北那两行之间的间距
引用 4 楼 的回复:
引用 2 楼 的回复:
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
+1
还有一个问题,需要请教,怎么实现让上面两行之间的间距变的小点呢,就是河南河北那两行之……
用margin-top
引用 6 楼 的回复:
引用 4 楼 的回复:
引用 2 楼 的回复:
错误1:id值为NewsTop_tit的div标签没有正确关闭;
错误2:上面这个元素中的p元素数量与id值为NewsTop_cnt的div元素中的span子元素数量不匹配。
+1
还有一个问题,需要请教,怎么实现让上面两行之间的间距变的小……
不然就是padding-top
引用 7 楼 的回复:
引用 6 楼 的回复:
引用 4 楼 的回复:
引用 2 楼 的回复:
Error 1: The div tag with the id value NewsTop_tit is not closed correctly;
Error 2: The number of p elements in the above element does not match the number of span sub-elements in the div element with the id value NewsTop_cnt.
1
There is another question, I need to ask, how to implement it...
In Henan and Hebei, I use two DIVs. You mentioned margin-top and padding-top. Which one should I put it in?
#NewsTop_tit p, #NewsTop_two p { margin-bottom:0;}
To be honest, the code you posted is really bad and it is very difficult to adjust. Look at the margin-top and margin-bottom of the box model #NewsTop_tit p, #NewsTop_two p element The values are all 10px, but after forcibly changing the margin value like above, the effect is different in IE and other browsers.
CSS code
#NewsTop_tit p, #NewsTop_two p {
margin-bottom:0;
}
I tried this and it works, thank you.

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



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

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