如何防止图像拉伸? [英] How do I prevent the image from stretching?

查看:77
本文介绍了如何防止图像拉伸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想在此文本框的右侧放置一个16x16的日历图标。它运行正常,然后我购买了一个模板,在应用模板后,图像开始出现在文本框下方,并且延伸了div的长度。



。联系表格{

职位:亲属;

vertical-align:top;

z-index:1;

保证金:0;

顶部:-10px;

}

.contact-form .txt-form {

display:none;

}

.contact-form .coll-1,.contact-form .coll-2,.contact-form .coll-3 {

保证金底部:23px;

浮动:左;

宽度:200px;

}

.contact-form .coll-1 p,.contact-form .coll-2 p,.contact-form .coll-3 p {

margin-bottom:3px;

}

.contact-form .coll-1,.contact-form .coll-2 {

margin-right:10px; < br $>
}

.contact-form fieldset {

top:9px;

border:none;

填充:0;

宽度:100%;

位置:相对;

z-index:10;

}

.contact-form label {

display:block;

min-height:45px;

position:relative;

保证金:0;

填充:0;

浮动:左;

宽度:100%;

}



I am simply trying to place a 16x16 calendar icon to the right of this text box. It was working fine, then I purchased a template and after applying the template, the image started appearing below the text box and is stretching the length of the div.

.contact-form {
position: relative;
vertical-align: top;
z-index: 1;
margin: 0;
top: -10px;
}
.contact-form .txt-form {
display: none;
}
.contact-form .coll-1, .contact-form .coll-2, .contact-form .coll-3 {
margin-bottom: 23px;
float: left;
width: 200px;
}
.contact-form .coll-1 p, .contact-form .coll-2 p, .contact-form .coll-3 p {
margin-bottom: 3px;
}
.contact-form .coll-1, .contact-form .coll-2 {
margin-right: 10px;
}
.contact-form fieldset {
top: 9px;
border: none;
padding: 0;
width: 100%;
position: relative;
z-index: 10;
}
.contact-form label {
display: block;
min-height: 45px;
position: relative;
margin: 0;
padding: 0;
float: left;
width: 100%;
}









截止日期*


Due Date*











我尝试了什么:



我在图像上尝试了浮动和各种显示选项。



What I have tried:

I've tried float and various display options on the image.

推荐答案

在你的CSS中,在css类中将Position的属性更改为static,如下所示:



position:static



这将不允许图像伸展。有关职位的更多信息,您可以访问此链接

CSS布局 - 职位属性 [ ^ ]
In your CSS, change the property of Position to static in the css class like this:

position: static

this will not allow the image to stretch. For further more information about position you can visit this link
CSS Layout - The position Property[^]


这篇关于如何防止图像拉伸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆