我正在尝试减小我的 wordpress 网站上滑块的大小:
////
滑块是 435 像素,我做了一些研究,但找不到位置。
我确实更改了 style.css 中的滑块高度:
#slider {
position:relative;
width:1000px;
height:400px;
background:url(images/loading.gif) no-repeat 50% 50%;
但它仍然显示 435 像素。
有谁能帮助我吗?
谢谢!
从#sliderdiv 的 html :
<div id="slider" class="nivoSlider" style="position: relative; height: 435px; background-image: url(http://www.webgiants-im.nl/wp-content/uploads/2013/04/internet_marketing_webgiants-im_2.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat;">
您可以看到height: 435px标记中有一个,默认情况下它优先于 .css 文件或<style></style>块中定义的样式。
您可以在 css 文件中将高度标记为 !important ,这将强制使用此值:
#slider {
position:relative;
width:1000px;
height:400px !important;
background:url(images/loading.gif) no-repeat 50% 50%;
}
或height: 435px从 div 的 html 标记中删除#slider,或将其值设置为 400px。
编辑:为了在将来为您省去一些麻烦,您应该使用 Web 调试工具,如 Firebug(用于 Firefox)或 Chrome 的开发工具(我个人更喜欢后者),这些可能非常有用。如果 F12 在大多数流行的浏览器上,我认为键盘快捷键可以带来浏览器的开发工具。