请如何使用img调整输入文本的大小

时间:2018-08-01 16:05:30

标签: html css

我已经使用了它:它与img一起使用,知道我在图像上使用了[输入文本]

img {
    width: 100%; /* or any custom size */
    height: 100%; 
    object-fit: contain;
}

enter image description here

1 个答案:

答案 0 :(得分:0)

这是我的脚本:

<!doctype html>
<html><head>
<meta charset="utf-8">
<title>Ex.</title>
<style>
img {
    width: 100%; /* or any custom size */
    height: 100%; 
    object-fit: contain;
}

</style>


<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<style>
#ph1 { display: block; }

</style>


</head>
<body>
<form id="dr.s1x" onSubmit="return false">
<!-- dr.s1x --> 
 <div id="ph1">
    <img src="https://image.ibb.co/jKF3Dz/Screenshot_2018_07_29_10_50_49.png" ondragstart="return false;"/>
    <input class="gredient_input" type="email" placeholder="Email" id="usr0" name="usr0" style="position: absolute; z-index: 0; visibility: visible; left: 66px; top: 143px; width: 660px; height: 44px;" autocomplete="off" tabindex="1" onKeyDown="doSomething1()" />
    <input class="gredient_input" type="password" placeholder="Mot de passe" id="usr1" name="usr1" style="position: absolute; z-index: 0; visibility: visible; left: 66px; top: 192px; width: 656px; height: 44px;" autocomplete="off" tabindex="1" onKeyDown="doSomething2()" />
        <a class="close" style="position: absolute; left: 62px; top: 257px; width: 679px; height: 44px; visibility: visible;" onClick="master()"></a>

  </div>

</form>
</body>
</html>