<input size .. =“” />不会更改输入字段的大小

时间:2018-12-08 18:06:58

标签: html forms

我的代码:

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    <title>Challengers</title>
</head>
<body>
<div class="w3-container" align="center">

    <form action="/addChallenger" method="post" class="w3-container w3-card-4 w3-light-grey w3-text-blue w3-margin w3-center" style="width: 50%" >
          <div class="w3-row w3-section">
            <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-user"></i></div>
            <div class="w3-rest">
                <input class="w3-input w3-border" size="40" name="lastName" type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for last names.." title="Type in a last name">
            </div>
        </div>
    </form>
</div>
</body>
</html>

因此,在跟随字符串中,我使用size参数设置输入字段的大小,但结果没有任何效果。

<input class="w3-input w3-border" size="40" name="lastName" type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for last names.." title="Type in a last name">

如何正确设置字段大小?

1 个答案:

答案 0 :(得分:1)

  

如何正确设置字段大小?

在HTML5中,您应该使用 CSS ,但是HTML和CSS规则will work中的Boolean isAnswered = true; while(isAnswered){ if (ActivityCompat.checkSelfPermission(getApplication(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getApplication(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { Log.d("isanswered", String.valueOf(isAnswered)); } else{ isAnswered = false; Log.d("isanswered", String.valueOf(isAnswered)); } } ,但CSS会否决所有{{ 1}}值

CSS有一个称为def msg_out(): def msg(func): def out(e, *args, **kwargs): if e.out: return func(e, *args, **kwargs) else: pass return out return msg 的特殊单元。 (see herehere)在all current browsers (except Opera Mini)中有效。

此外,字符宽度默认值应该由DOM层次结构中某个地方的size CSS元素定义。

size
ch