2017-10-16 37 views
-5

我正在开发一个网站,其网址为http://notice.byethost12.com。我已经完成了大部分工作,但是我在将任何徽标显示为调整大小以适应它们的网格时遇到问题。所以高而有些宽。如果不是最舒适的话。我对此很新。所以如果你能帮忙,我会很高兴。如何将任何徽标缩小并固定在固定框中

+1

不知道你已经尝试过,但一个好地方开始:'img {max-width:100%;最大高度:100%;宽度:自动;身高:自动}' – UncaughtTypeError

+1

发表一个例子,给我们你的问题。不要只是发布一个随机链接说这个没有工作,fix ty。 SO不是免费的编码服务,也不是教程网站 –

+0

你可以尝试设置'background-size:contains; background-repeat:no-repeat;''.thumbnail-image'类。 – Krusader

回答

0

好吧,由于您在thumbnail-image类中使用了背景图片,因此您需要指定background-sizebackground-repeat规则。

添加到您的CSS:

.thumbnail-image { 
    background-size: 100%; 
    background-repeat: no-repeat; 
} 

希望有所帮助。

+0

这不起作用。 –

+0

你是什么意思?你可以发布你的代码吗? –

+0

可能是因为您在选择器中需要更多特征,例如:'.grid-plus-container .post-item .thumbnail-image background-size:contains; background-repeat:no-repeat; background-position:center center; }' – UncaughtTypeError