简体   繁体   English

小工具背景颜色变化

[英]Gadget Background Colour Change

I'm having trouble changing the background colour of my popular posts widget on my website. 我在更改网站上热门帖子小部件的背景颜色时遇到问题。 I figured out the problem was linked to my sticky navigation menu. 我发现问题出在我的粘性导航菜单上。 So my sticky navigation menu's background is black and for some reason this has also affected the background colour of my popular posts widget. 因此,我的粘性导航菜单的背景为黑色,由于某种原因,这也影响了我受欢迎的帖子小部件的背景颜色。 This is my code for the background colour for my sticky navigation 这是我的粘性导航的背景色代码

/* Background & Border of Navigation */
.tabs-inner .widget ul {
background: #000000;
border: 0px solid #eeeeee;
text-align: center  !important;
}

I want the background colour of my popular posts widget to be transparent or white while keeping the background colour of my sticky navigation black. 我希望我的热门帖子窗口小部件的背景颜色是透明或白色,同时使粘性导航的背景颜色保持黑色。

Here's my code for my popular post 这是我受欢迎的帖子的代码

<style type='text/css'>
.PopularPosts .item-thumbnail a {
clip: auto;
display: block;
height: 180px;
overflow: hidden;
width: 240px;
margin-left: -10px;
}
.PopularPosts .item-thumbnail img {
position: relative;
top: -30px;
transition:all .2s linear;
-o-transition:all .5s linear;
-moz-transition:all .2s linear;
-webkit-transition:all .2s linear;
}

.PopularPosts .item-thumbnail img:hover{
background: transparent;
opacity:.6;
filter:alpha(opacity=60)
}
.PopularPosts .widget-content ul li {
color: #555555;
}

.PopularPosts .item-title {
clear:both;
font: 10px verdana;
color: #222222;
text-transform: uppercase;
text-align: center;
margin-right: 10px;
}

.PopularPosts .item-snippet {
display: none;
}

.widget .widget-item-control a img {
height: 18px;
width: 18px;

}

</style>

I've tried implementing 我尝试实施

background: #ffffff;

within that block of code but it still does not change the background colour? 在该代码块中,但是它仍然不会更改背景颜色? Any ideas on how to fix this? 有想法该怎么解决这个吗?

Insert this in your <head> inside of <stye> tags: 将其插入<stye>标记内的<stye> <head>中:

    .tabs-inner .section:first-child ul {
       background: #000 !important;
    }
    .tabs-inner .widget ul {
       background: transparent !important;
    }

Update: To center the li elements 更新:li元素居中

    .popular-posts ul { 
       margin: auto !important; 
       width: 1040px !important;
    }

May be you need to use @Media queries , to control the width of these list in mobile devices. 可能是您需要使用@Media查询来控制这些列表在移动设备中的宽度。

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

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