Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial About the gap between two DIVs_html/css_WEB-ITnose

About the gap between two DIVs_html/css_WEB-ITnose

Jun 24, 2016 pm 12:08 PM

<div style="background-image: url('images/DI.png');width: 1048px;margin-top: 3px; height: 800px;overflow:hidden">
<div>
<img src="images/backhome.png" style="width:1048px;height: 469px;"/>
</div>
<div id="carousel" style="width:1070px;margin-left: -12px;margin-top: 100px;">
<img src="images/carousel_btn_lastpic.png" id="carousel_btn_lastpic" title="上一组" onclick="move('right')" style="cursor:pointer;width: 26px;height: 27px;margin-top: 40px;"/>
<img src="images/carousel_btn_nextpic.png" id="carousel_btn_nextpic" title="下一组" onclick="move('left')" style="cursor:pointer;width: 26px;height: 27px;margin-top: 40px;"/>
<div id="imgList">
<ul>
 <li><a href="youandme.html"><img src="images/youandmeli.png" title="与你同行"></img></a></li>
 <li><a href= "zhaopengyou.html"><img src="images/findfriendlyli.png" title="找朋友"></img></a></li>
 <li><a href="internethome.html"><img src="images/internethome.png" title="家庭网络存储器"></img></a></li>
 <li><a href="heightqing.html"><img src="images/01.png" title="网络高清播放器"></img></a></li>
 <li><a href="lubanchi.html"><img src="images/lubanchili.png" title="手机鲁班尺"></img></a></li>
 <li><a href="product.html"><img src="images/game.png" title="游戏"></img></a></li>
</ul>
         </div>
         </div>我的DIV是这样的为什么会有一小缝隙?


回复讨论(解决方案)

这代码贴的看不出毛病来

*{margin:0;padding:0}看看这样行吗
Copy after login

图片的原因看不到效果,你试试楼上的重置
*{margin:0;padding:0}

img{ display:block;}
还有一种可能是margin导致空隙!

哎。。发现竟然是美工给我的图下面有一条线的原因我晕死

我想问下。。为什么我的<li>列表里面的图片高度怎么给定呢。。我给定的有但是一直出现一半除非把图片改的非常小。。<style type="text/css">
body{ border: 0px; margin:0;font-family : "Lucida Grande", Verdana, Lucida, Arial, Helvetica, 宋体,sans-serif;}
body,div,ul,form{padding:0;margin:0;list-style-type:none;}
ul{margin:0; padding:0; list-style:none;padding-bottom: 200px;}
#imgList{ width:770px; height:300px; /* 定义显示窗口的大小 */
 border:0px solid white; overflow:hidden}
#imgList ul{ width:1820px;} /* 定义全部图片的宽度和,这里有5张,每张宽100px,总宽度就是500px */
#imgList li{ width:220px; height:220px; float:left;} /* 单张图片的所在位置的大小,宽度就是图片宽度加左右边距 */
#imgList img{ width:200px; height:150px; margin:10px;} /* 单张图片的尺寸,及外边距 */ 这是我的CSS里面的。。

<table background="kuang.png" width="900" height="400">
  <tr align="center" height="30">
    <td ><p style="color: black;margin-left: -500px;margin-top: 3px;" >游戏</p></td>
 </tr>
  <tr>
    <td style="float: left;margin-top: 100px;overflow: hidden;">
    <div id="carousel" style="width:900px;margin-left: 60px;">
     <img src="images/left.png" id="carousel_btn_lastpic" title="上一组" onclick="move('right')" style="cursor:pointer;width: 26px;height: 27px;margin-top: 40px;"/>
<img src="images/right.png" id="carousel_btn_nextpic" title="下一组" onclick="move('left')" style="cursor:pointer;width: 26px;height: 27px;margin-top: 40px;"/>
<div id="imgList">
<ul>
     <li><a href = "rabbitgame.html"><img src = "images/gameone.png" style="margin-left: px;" title="推推兔"/></a></li>
     <li><a href = "savegame.html"><img src="images/gametwo.png" title="啊。。救命"/></a> </li>
    <li><a href="savegame.html"><img src="images/gametwo.png" title="啊。。救命"/></a></li>
   </ul>
   <ul>
    <li><p style="margin-left: 180px;color: white;font-size: 25px;font-family: 黑体;">推推兔</p></li>
    <li><p style="margin-left: 80px;font-size: 25px;color: white;">啊 救命</p></li>
    <li><p style="margin-left: 80px;font-size: 25px;color: white;">啊 救命</p></li>
   </ul>
   </div></div>
</td></tr>
</table>This is my code below. . . Why, great gods

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 Article

Hot Article

Hot Article Tags

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)

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Mar 04, 2025 pm 12:32 PM

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

How do I use HTML5 form validation attributes to validate user input?

How to efficiently add stroke effects to PNG images on web pages? How to efficiently add stroke effects to PNG images on web pages? Mar 04, 2025 pm 02:39 PM

How to efficiently add stroke effects to PNG images on web pages?

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

What is the purpose of the <iframe> tag? What are the security considerations when using it?

What are the security implications of using iframes, and how can I mitigate them? What are the security implications of using iframes, and how can I mitigate them? Mar 18, 2025 pm 02:51 PM

What are the security implications of using iframes, and how can I mitigate them?

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

What are the best practices for cross-browser compatibility in HTML5?

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

How do I use the HTML5 <time> element to represent dates and times semantically?

How do I use the HTML5 <meter> element to display numerical data within a range? How do I use the HTML5 <meter> element to display numerical data within a range? Mar 12, 2025 pm 04:08 PM

How do I use the HTML5 <meter> element to display numerical data within a range?

See all articles