gpt4 book ai didi

html - 仅将 CSS 应用于一个输入字段

转载 作者:太空宇宙 更新时间:2023-11-04 14:32:23 27 4
gpt4 key购买 nike

我有一个jsp页面。它包含 no.of 输入字段。我为我的 jsp 页面添加了 Css。现在的问题是,当我使用下面附加的 css 时,它正在应用于所有输入字段。我只想将它应用于 UserName 字段。

JSP 页面

<form method="post" action="./DataCaptureServlet" autocomplete="OFF">
<table id="table1" align="center">
<tr>
<th>Data Capturing Screen</th>
</tr>
</table>
<br>
<table id="finalTable" align="center">
<tr>
<td>
<table id="table2">
<tr>
<td style="padding-left: 635px"><b>User Name</b><td>
<td><b>:</b></td>
<td><input type="text" name="username" id="username" value="Asha" readonly="readonly"></td>
</tr>
</table>
<br>
<br>
<table align="center" id="table3">
<tr>
<td><b>Date Of Capture :</b></td>
<td><input type="text" name="dateofcapture" id="dateofcapture"></td>
<td><b>Time Capture :</b></td>
<td><input type="text" name="timecapture" id="timecapture"></td>
</tr>
<tr>
<td><b>Adjuster Co :</b></td>
<td><input type="text" name="adjusterco" id="adjusterco"></td>
<td><b>Adjuster Name :</b></td>
<td><input type="text" name="adjustername" id="adjustername"></td>
</tr>
</table>
<table align="center" id="table4">
<tr>
<td><b>Owner Name :</b></td>
<td><input type="text" name="ownername" id="ownername"></td>
<td></td>
<td><b>Tel:1)</b><input type="text" name="telno1" id="telno1">
<b>2)</b><input type="text" name="telno2" id="telno2">
</td>
</tr>
<tr>
<td><b>Location :</b></td>
<td><input type="text" name="location" id="location"></td>
<td><b>PostCode :</b></td>
<td><input type="text" name="postcode" id="postcode"></td>
</tr>
<tr>
<td><b>Remarks :</b></td>
<td><textarea name="remarks" id="remarks"></textarea></td>
</tr>
<tr>
<td><b>Nature Of Case :</b></td>
<td><input type="checkbox" name="insurance" id="insurance"><b>Insurance</b></td>
<td><input type="checkbox" name="renovation" id="renovation"><b>Renovation</b></td>
<td><input type="checkbox" name="tender" id="tender"><b>Tender</b></td>
<td><input type="checkbox" name="othersofnature" id="othersofnature"><b>Others(pls specify)</b></td>
</tr>
<tr>
<td><b>D.O.L :</b></td>
<td><input type="text" name="dol" id="dol"></td>
<td><b>Cause :</b></td>
<td><input type="checkbox" name="fire" id="fire"><b>Fire</b></td>
<td><input type="checkbox" name="windstorm" id="windstorm"><b>Windstorm</b></td>
<td><input type="checkbox" name="flood" id="flood"><b>Flood</b></td>
<td><input type="checkbox" name="othersofcause" id="othersofcause"><b>Others</b></td>
</tr>
<tr>
<td><b>Sum Insured :</b></td>
<td><input type="text" name="suminsured" id="suminsured"></td>
</tr>
<tr>
<td><b>Policy Info :</b></td>
<td><input type="text" name="poicyinfo" id="poicyinfo"></td>
</tr>
<tr>
<td><b>Assign to :</b></td>
<td><b>Marketing :</b></td>
<td><input type="text" name="marketing" id="marketing"></td>
<td><b>QS :</b></td>
<td><input type="text" name="qs" id="qs"></td>
</tr>
</td>
</tr>
</table>
</table>
<table align="right">
<tr>
<td colspan="3">
<input type="submit" value="Submit/Save" name="loginsubmit" id="submit"/>
</td>
</tr>
</table>
</form>

CSS

input[type="text"]{
border: 0;
border-bottom: 1px solid black;
outline: 0;}

最佳答案

input#username
{
border: 0;
border-bottom: 1px solid black;
outline: 0;
}

#username
{
border: 0;
border-bottom: 1px solid black;
outline: 0;
}

input[name=username]
{
border: 0;
border-bottom: 1px solid black;
outline: 0;
}

关于html - 仅将 CSS 应用于一个输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33034583/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com