无法控制导航栏和图像之间的空间 [英] Unable to conrol space between nav bar and images

查看:63
本文介绍了无法控制导航栏和图像之间的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在div内,我有一个水平导航栏,并且在该栏下面有一些图像,这些图像是链接.我无法控制图像和条形图之间的间距,即我希望将图像向上移动,更靠近条形图的底部,但无法这样做.我已经尝试了所有我能想到的东西,例如边距,填充等,但似乎没有任何效果.我想知道是否有人有解决方案?所有帮助将不胜感激.

Hi,
Inside a div I have a horizontal navigation bar and some images, which are links, below the bar. I am unable to control the spacing between the images and the bar, i.e. I wish to move the images up, closer to the bottom of the bar, but am unable to do so. I have tried everything I could think of, margins, padding, etc. but nothing seems to be working. I wonder if anyone has any solutions? All help would be greatly appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <style type="text/css">
    body
    { text-align: center;
      min-width: 1044px;
      margin: 0px;
      padding: 0px;
      font-family: arial;
    }
    #wrapper
    { position: relative;
      text-align: left;
      width: 1044px;
      height: 100%;
      margin: 0px auto;
    }
    #top-header-block
    { width: 1010px;
      height: 170px;
      background-color: cyan;
    }
    ul#list-nav
    { list-style:none;
      clear: both;
      margin-top:12px;
      padding:0;
      width:1104px;
      float:left;
    }
    ul#list-nav li
    { display:inline
    }
    ul#list-nav li a
    { text-decoration:none;
      padding:5px 0px;
      width:100px;
      height: 3.20em;
      line-height: 3.20em;
      background: url(blue_square_A.jpg) #0d2474 bottom left repeat-x;
      color:#FFFFFF;
      float:left;
      text-align:center;
      border-left:1px solid #fff;
      font-size: 12px;
      font-weight: bold;
    }
    ul#list-nav li a.noBorder
    { border-left: 0;
    }
    ul#list-nav li a.widthA
    { width:90px;
    }
    ul#list-nav li a.widthB
    { width:72px;
    }
    ul#list-nav li a.widthC
    { width: 80px;
      background: #990000;
    }
    ul#list-nav li a.widthD
    { padding: 0px;
      background: #FF8C00;
      width: 80px;
      height: 48px;
    }
    ul#list-nav li a img.noBorder
    { border-style: none;
    }
    ul#list-nav li a:hover
    { text-decoration:none;
      background-color: #3333CC;
      color:#FFFFFF;
    }
    img.delivery
    { margin-left: 15px;
      float: left;
    }
    img.lorry
    { float: right;
      margin-right: 25px;
    }
  </style>
</head>
<body>
  <div id="wrapper">
    <div id="top-header-block">
    <ul id="list-nav">
      <li><a class="noBorder"

             href="#">****** ******</a></li>
      <li><a href="#">*** *******</a></li>
      <li><a href="#">*** ** *** **</a></li>
      <li><a href="#">***********</a></li>
      <li><a class="widthA"

             href="#">*********</a></li>
      <li><a href="#">*********</a></li>
      <li><a href="#">*************</a></li>
      <li><a class="widthB"

             href="#">****</a></li>
      <li><a class="widthC"

             href="#"

              onMouseOver="this.style.background='#DC143C'"

               onMouseOut="this.style.background='#990000'">******</a></li>
      <li><a class="widthB"

             href="#">****</a></li>
      <li><a class="widthD"

             href="#"

              onMouseOver="this.style.background='#FF8C00'">
               <img class="noBorder" src=""

               alt="" width="73" height="44" /></a></li>
    </ul>
    <a href="#">
      <img class="delivery" src="" alt="" width="122" height="25"/>
    </a>
    <a href="#">
      <img class="delivery" src="" alt="" width="90" height="25"/>
    </a>
    <a href="#">
      <img class="delivery" src="" alt="" width="85" height="25"/>
    </a>
    <a href="#">
      <img class="delivery lorry" src="" alt="" width="288" height="25"/>
    </a>
  </div>
</div>
</body>
</html>

推荐答案

您放错了div ...这是您想要的...如果还是不满意,请指定您想要的更多内容

You misplace the div...Is this you want ...If still not satisfy then please specified more what you exaclty want

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <style type="text/css">
    body
    { text-align: center;
      min-width: 1044px;
      margin: 0px;
      padding: 0px;
      font-family: arial;
    }
    #wrapper
    { position: relative;
      text-align: left;
      width: 1044px;
      height: 100%;
      margin: 0px auto;
    }
    #top-header-block
    { width: 1010px;
      height: 170px;
      background-color: cyan;
    }
    ul#list-nav
    { list-style:none;
      clear: both;
      margin-top:12px;
      padding:0;
      width:1104px;
      float:left;
    }
    ul#list-nav li
    { display:inline
    }
    ul#list-nav li a
    { text-decoration:none;
      padding:5px 0px;
      width:100px;
      height: 3.20em;
      line-height: 3.20em;
      background: url(blue_square_A.jpg) #0d2474 bottom left repeat-x;
      color:#FFFFFF;
      float:left;
      text-align:center;
      border-left:1px solid #fff;
      font-size: 12px;
      font-weight: bold;
    }
    ul#list-nav li a.noBorder
    { border-left: 0;
    }
    ul#list-nav li a.widthA
    { width:90px;
    }
    ul#list-nav li a.widthB
    { width:72px;
    }
    ul#list-nav li a.widthC
    { width: 80px;
      background: #990000;
    }
    ul#list-nav li a.widthD
    { padding: 0px;
      background: #FF8C00;
      width: 80px;
      height: 48px;
    }
    ul#list-nav li a img.noBorder
    { border-style: none;
    }
    ul#list-nav li a:hover
    { text-decoration:none;
      background-color: #3333CC;
      color:#FFFFFF;
    }
    img.delivery
    { margin-left: 15px;
      float: left;
    }
    img.lorry
    { float: right;
      margin-right: 25px;
    }
  </style>
</head>
<body>
  <div id="wrapper">
    <div id="top-header-block">
    <ul id="list-nav">
      <li><a class="noBorder"

             href="#">****** ******</a></li>
      <li><a href="#">*** *******</a></li>
      <li><a href="#">*** ** *** **</a></li>
      <li><a href="#">***********</a></li>
      <li><a class="widthA"

             href="#">*********</a></li>
      <li><a href="#">*********</a></li>
      <li><a href="#">*************</a></li>
      <li><a class="widthB"

             href="#">****</a></li>
      <li><a class="widthC"

             href="#"

              onMouseOver="this.style.background='#DC143C'"

               onMouseOut="this.style.background='#990000'">******</a></li>
      <li><a class="widthB"

             href="#">****</a></li>
      <li><a class="widthD"

             href="#"

              onMouseOver="this.style.background='#FF8C00'">
               <img class="noBorder" src=""

               alt="" width="73" height="44" /></a></li>
    </ul>
    </div>
    <!--You misplace the div...Is this you want ...If still not satisfy then please specified more what you exaclty want-->
    <a href="#">
      <img class="delivery" src="" alt="" width="122" height="25"/>
    </a>
    <a href="#">
      <img class="delivery" src="" alt="" width="90" height="25"/>
    </a>
    <a href="#">
      <img class="delivery" src="" alt="" width="85" height="25"/>
    </a>
    <a href="#">
      <img class="delivery lorry" src="" alt="" width="288" height="25"/>
    </a>
</div>
</body>
</html>


这篇关于无法控制导航栏和图像之间的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆