html - 将标签缩略图中的图像居中

标签 html css blogger

我有一个非常有效的特定模板,直到有一天主页上缩略图上的图像搞砸了。我什至不知道发生了什么,也无法修复它。

看起来图像缩略图只显示左上侧,当我使用

img.label_thumb {
    width: 100%
}

在 CSS 中,它现在看起来很棒,但是与同一张图片一起使用的旋转木马看起来很糟糕。 我尝试更改轮播在 HTML 中的显示方式,但我做不到。

网站是 recapblog.com,伙计们,我开始真的很绝望,我尝试了我所知道的一切,我可以在互联网上找到(甚至认为不多)。 它应该如何在缩略图和轮播中显示

enter image description here

CSS 的外观

enter image description here

我发现了一些我以前没有尝试过的东西,但我害怕触碰某些东西并把它弄得一团糟! 就是这样:

//jCarouselLite 插件 (函数($){$.fn.jCarouselLite=函数(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing: null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b= false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi =$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone( )).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start ;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0 ",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position :"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=gitemLength;var j=gv;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-( curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if (o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,函数(i,a) {$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d) {return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o. auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart. call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g) +"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v +1){ul.css(animCss,-((v)g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr= a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(currg )}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false}) ;if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("禁用");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.滚动>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b ))||0};函数宽度(a){返回a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};函数高度(a){返回a[0 ].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery); $(函数() { $(".cover").jCarouselLite({ btnNext: ".下一个", btnPrev: ".prev", 汽车:4000, 速度:800 }); });

最佳答案

好的,所以你必须删除它:

.img.label_thumb {
    width: 100%;
}

从这条规则中移除 width 100% 它应该可以正常工作

但如果您想保留此规则,则必须添加 height : 100% 以使图像适合轮播高度

关于html - 将标签缩略图中的图像居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28834615/

相关文章:

css - 在 Contact Form 7 中选中时的单选标签背景颜色

php - 在 Lightbox 上定位关闭按钮

html - CSS:右列不再位于菜单栏下方

javascript - 如何按标签过滤 Blogger feed?

html - 如何将 flex box 元素设置为没有宽度的动画?

html - 如何删除 webkit 中损坏图像周围的边框?

javascript - 单击时强制打开下拉菜单

javascript - 带有 2 个选择框的动态表

css - float 内容下的粘性页脚

html - Blogger API 未从博客中检索所有帖子