Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial 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

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

Jun 24, 2016 pm 12:12 PM

ceshi







  
    
      社区导航


      河南


      山东


      湖南


      广东


  江苏


  四川


  陕西


  宁夏


  云南


  海南


  台湾


  浙江


  吉林


  黑龙江


  北京


  重庆


  澳门



 
  
   


 河北


 山西


 湖北


 广西


 江西


 安徽


 甘肃


 青海


 贵州


 福建


 

西藏


 

新疆


 

辽宁


 

内蒙古


 

上海


 

天津


 

香港


 

    

 




  郑州
      安阳
      南阳
      信阳
      洛阳
      濮阳
      开封
      漯河
      许昌
      周口
      新乡
      周口

    





  郑州
      安阳
      南阳
      信阳
      洛阳
     

        





  郑州
      安阳
      南阳
    

    





  郑州
      安阳
      南阳
        新乡
  周口

    

    



  郑州
      新乡
  周口

    





  郑州
        新乡
  周口

    





  郑州
        新乡
  周口

    





  郑州
        周口

    





  郑州
        新乡
  周口

    





  郑州
        周口

    





  郑州
       新乡
  周口

    





  郑州
       新乡
  周口

    





  郑州
       新乡
  周口

    





  郑州
         新乡
  周口

    





  郑州
      安阳
      新乡
  周口

    





  郑州
      安阳
        新乡
  周口

    

  

            <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;}
Copy after login

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.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

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

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

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.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

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

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

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.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

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

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

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.

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

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

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

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

See all articles