建立一个新网站,并在新闻自动收报机上工作,它下面有哈希标记用于导航。哈希标记位于股票代码模块底部的绝对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>
CURRENT 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;
}
答案 0 :(得分:1)
容器的vertical-align
设置为baseline
(default.css第39行)。
我建议将其设置为top
:
div.newsFeedNavsInner {
vertical-align:top;
}
根据您新发布的代码,在每个导航项上设置它:
.newsNavItems {
....
vertical-align:top;
}
答案 1 :(得分: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;
}