0

建立一个新站点,并在新闻行情上工作,它下面有用于导航的井号。哈希标记位于代码模块底部的绝对 div 中。div 里面是锚标签和一些垫片,它们在它们应该在下面渲染,我似乎无法确定原因,有人可以看看并帮助我吗?

http://race.3drexstaging.com/Home 是链接。

谢谢你的帮助

HTML

<div class="dnnForm Normal NewsFeedHolder">
    <div class="newsFeedInner">

                <div class="feedItems" id="newsItem0">
                    <span class="feedTitles">Featured Promotions : </span>
                    <span class="feedTexts">Example - 50% OFF SALE! On Select Products and Services</span>
                </div>

                <div class="feedItems inactive active" id="newsItem1">
                    <span class="feedTitles">Another Headline : </span>
                    <span class="feedTexts">You can put info about another sale here</span>
                </div>

                <div class="feedItems inactive" id="newsItem2">
                    <span class="feedTitles">Yet Another Headline : </span>
                    <span class="feedTexts">More information about your sale</span>
                </div>

    </div>
    <div class="newsFeedNavs">
        <div class="newsFeedNavsInner">

                    <a class="newsNavItems" id="newsNavItem0" href="javascript:getNewsItem(0)"></a>

                    <span class="newsSpacer"></span>

                    <a class="newsNavItems inactive active" id="newsNavItem1" href="javascript:getNewsItem(1)"></a>

                    <span class="newsSpacer"></span>

                    <a class="newsNavItems inactive" id="newsNavItem2" href="javascript:getNewsItem(2)"></a>

        </div>
    </div>
</div>

当前CSS:

.feedItems
{
    color: white;
}
.feedTitles
{
    font-weight: bold;
    color: #ce0d25;
    margin-right: 10px;
}
.feedTexts
{

}
.NewsFeedHolder
{
   position: relative;
}
.newsFeedInner
{
    padding-top: 15px;
    padding-bottom: 15px;
    text-align: center;
    font-size: 10pt;
}
.newsFeedNavs
{
    text-align: center;
    position: absolute;
    height: 2px;
    bottom: -2px;
    left: 0px;
    right: 0px;
}
.newsFeedNavsInner {
    height: 2px;
    display: inline-block;
    background-color: black;
    padding-right: 15px;
    padding-left: 15px;
}
.newsNavItems
{
    display: inline-block;
    width: 15px;
    height: 2px;
    overflow: hidden;
    text-indent: -9999px;
    background-color: white;
    line-height: 2px;
    margin: 0px;
    padding: 0px;
}
    a.newsNavItems:hover, a.newsNavItems.active
    {
        background-color: red;
    }
.feedItems
{
    display: none;
}
    .feedItems.active
    {
        display: block;
    }
.newsSpacer {
    display: inline-block;
    width: 15px;
    line-height: 2px;
    height: 2px;
    margin: 0px;
    padding: 0px;
}
4

2 回答 2

1

您的vertical-align容器设置为baseline(default.css 第 39 行)。

我建议将其设置为top

div.newsFeedNavsInner {
  vertical-align:top;
}

编辑:

给定您新发布的代码,将其设置在每个导航项上:

.newsNavItems {
    ....
    vertical-align:top;
}

http://jsfiddle.net/qrjwU/

于 2013-09-17T22:15:26.113 回答
1

在此处输入图像描述

.newsFeedNavsInner {
  height: 2px;
  display: inline-block;
  background-color: black;
  padding-right: 0;
  padding-left: 30px;
}
.newsNavItems {
  display: block;
  float: left;
  width: 15px;
  height: 2px;
  overflow: hidden;
  text-indent: -9999px;
  background: white;
  line-height: 2px;
  margin: 0 10px;
  padding: 0px;
}

或者

在此处输入图像描述

.newsFeedNavsInner {
  height: 2px;
  display: inline-block;
  background-color: black;
  padding-right: 15px;
  padding-left: 15px;
}
.newsNavItems {
  display: block;
  float: left;
  width: 15px;
  height: 2px;
  overflow: hidden;
  text-indent: -9999px;
  background: white;
  line-height: 2px;
  margin: 0;
  padding: 0;
}
.newsSpacer {
  display: inline-block;
  float: left;
  width: 15px;
  line-height: 2px;
  height: 2px;
  margin: 0px;
  padding: 0px;
}
于 2013-09-17T22:20:08.607 回答