简体   繁体   English

固定导航与图像重复-x

[英]fixed navigation with image repeat-x

I am struggling with making my navigation bar fixed and at the same time let the repeat be "repeat-x". 我正在努力固定导航栏,同时让重复显示为“ repeat-x”。 Below is an image of the result when using the css further down. 下面是进一步使用css时结果的图像。 在此处输入图片说明

Here is the css code included in the toplinks (navigation bar). 这是顶部链接(导航栏)中包含的CSS代码。

.toplinks {
    /*float: right;*/
    {vb:stylevar right}:{vb:math {vb:stylevar padding}*2};
    color:{vb:stylevar toplinks_link_color};
    font: {vb:stylevar header_font};
    text-align:{vb:stylevar right};
    background:{vb:stylevar toplinks_background};
    padding-top: 10px;
    height: 35px;
    background-attachment: scroll;
    background-image: url({vb:stylevar imgdir_misc}/top-links-bg.jpg);
    background-repeat: repeat-x;
    background-position: left top;
    background-color: #633f24;
    z-index: 20;
    position: fixed;
}

The navigation bar was not made by me, but I added "position" and "z-index". 导航栏不是我创建的,而是添加了“位置”和“ z-index”。 I want the bar to go across the page with repeat-x. 我希望栏与repeat-x一起贯穿页面。

Is this possible to do, if so could you help me out? 如果可以的话,这有可能吗?

http://a-trix.net/ http://a-trix.net/

Try setting the containing element to position: relative; 尝试将包含元素设置为position:relative; then set left: 0; 然后左移:0;

It doesn't look necessarily like a repeat-x issue, more that your element is being pushed across. 它看起来不一定像是repeat-x问题,更多的是您的元素被推入了。

Edit: 编辑:

.toplinks {
color: #eee2d6;
font: normal normal normal 11px Arial,Tahoma,Calibri,Verdana,Geneva,sans-serif;
text-align: right;
background: none;
padding-top: 10px;
height: 35px;
background-attachment: scroll;
background-image: url(http://a-trix.net/forum/images/primus/sandy/misc/top-links-bg.jpg);
background-position: left top;
background-repeat: repeat-x;
background-color: #633f24;
position: fixed;
width: 100%;
z-index: 1000;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM