属性值不匹配( | | auto | [初始 | 继承 | 取消设置 | 恢复])

问题描述 投票:0回答:3

我的项目中出现错误,但我找不到为什么会出现错误:

不匹配的属性值 ( | | auto | [初始 | 继承 | 取消设置 | 恢复]) less... (⌘F1)

此检查检测非法财产的价值。
属性值不匹配 ([[ | ] && [border-box | content-box]?] | available | -moz-available | min-content | -moz-min-content | max-content | -moz-max-content | fit-content | -moz-fit-content | auto | [初始 | 继承 | 取消设置 | 恢复]) less... (⌘F1)

此检查可检测非法财产的价值。

错在哪里?我认为我的代码没有问题。

我的 dode 如下:

<%@ page language="java"  pageEncoding="UTF-8"%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="${pageContext.request.contextPath}/css/buttonstyle.css" type="text/css" rel="stylesheet">
<LINK href="${pageContext.request.contextPath}/css/MainPage.css" type="text/css" rel="stylesheet">
<script type='text/javascript' src='${pageContext.request.contextPath}/script/pub.js'></script>
<script type="text/javascript" src='${pageContext.request.contextPath}/script/validate.js'></script>
<SCRIPT type="text/javascript">
function ini(){
   document.all.name.focus();
}
function check(){
    var theForm = document.forms[0];
    if(Trim(theForm.name.value)==""){
            alert("type in the username");
            theForm.name.focus();
            return false;
        }
    theForm.submit();
    return true; 
}
function checkNumberImage(){
    var imageNumber = document.getElementById("imageNumber");
    imageNumber.src = "${pageContext.request.contextPath}/image.jsp?timestamp="+new Date().getTime();
}
function checkFunction(){
    return check();
}
</SCRIPT>
<STYLE type=text/css>
BODY { margin: 0px; }
FORM {
    MARGIN: 0px; BACKGROUND-COLOR: #ffffff
} 
</STYLE>
<title>elec title</title>
</head>
<body onload="ini()">
<form action="${pageContext.request.contextPath}/menu/home.jsp" method="post" target="_top">
<table border="0" width="100%" id="table1" height="532" cellspacing="0" cellpadding="0" >
    <tr>
        <td> </td>
    </tr>
    <tr>
        <td height="467">
        <table border="0" width="1024" id="table2" height="415" cellspacing="0" cellpadding="0" >
        <br><br><br><br><br>
            <tr>
                <td width=12%></td>
                <td align=center background="${pageContext.request.contextPath}/images/index.jpg">
                <table border="0" width="98%" id="table3" height="412" cellspacing="0" cellpadding="0">
                    <tr height=122>
                        <td colspan=2></td>
                    </tr>
                    <tr>
                        <td height="313" width="73%"></td>
                        <td height="99" width="27%">
                            <table border="0" width="70%" id="table4">
                                <tr>
                                    <td width="100"><img border="0" src="${pageContext.request.contextPath}/images/yonghu.jpg" width="75" height="20"></td>
                                    <td><input type="text" name="name" style="width: 125 px" size="20" value=""  maxlength="25"></td>

                                </tr>
                                <tr>
                                    <td width="100"><img border="0" src="${pageContext.request.contextPath}/images/mima.jpg" width="75" height="20"></td>
                                    <td><input type="password" name="password" style="width: 125 px" size="20" value=""  maxlength="25"></td>

                                </tr>

                                <tr>
                                    <td width="100"></td>
                                    <td width="100"><input type="button" class=btn_mouseout onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'" value="login" name="huifubtn" onclick="checkFunction()"></td>

                                </tr>
                            </table>
                        </td>
                    </tr>

                    </table>
                </td>
                <td width=13%></td>
            </tr>
            <tr>
              <td align="center" colspan=3>&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
</table>
</form>
</body>
</html>
java jsp
3个回答
4
投票

我看到你的代码是:

<td><input type="password" name="password" style="width: 125 px" size="20" value=""  maxlength="25"></td>

您应该注意

css
值应该连续:
125px
不应该有空间。


1
投票

我在一些启用了 eslint 的 Vue.js 组件中遇到了同样的问题

position: 'absolute';

删除撇号后工作正常

position: absolute;

0
投票

您的样式属性应始终采用如下格式,以防止这些 IDE 出现问题:

style="width:125px;"

此外,您指定的尺寸值可能与您的样式值冲突。确保它适合您指定的像素值。我不会使用像素作为输入元素的尺寸,而是使用“em”。与“rem”不同,它可以在新旧浏览器中运行。将“em”或文本计数与尺寸计数加上额外值相匹配,您将永远不会出错,如下所示:

<input type="text" name="name" style="width:25em;" size="20" value="" maxlength="25">
© www.soinside.com 2019 - 2024. All rights reserved.