Is there any way who delivers a nice clean look to the html form style and makes it easier to follow? Can we align the fields and make the form labels bold with addition of CSS?
Who delivers a nice clean look to the html form style
Yes it is possible to deliver a nice clean look to a html form by bolding the labels. For this you have to write a html code in which you can specify the width, font size, text alignment etc.
I am showing you a small example of a html form so that you can get a better idea.
<FORM method="post">
<b>First name: </b><INPUT type="text" name="firstname"><BR><BR>
<b>Last name: </b><INPUT type="text" name="lastname"><BR><BR>
<b>email: </b><INPUT type="text" name="email"><BR><BR>
<b> Sex :</b><INPUT type="radio" name="sex" value="Male"> Male
<INPUT type="radio" name="sex" value="Female"> Female<BR><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</FORM>
This is the way you can write in html.
If you want to declare in CSS file then type
.form label { font-weight : bold; }
Then all the labels will be bold.
Answered By
Reyad
0 points
N/A
#128841
Who delivers a nice clean look to the html form style
Please try it..
<html>
<head>
<style rel="stylesheet" type="text/css">
.common{
font-weight:bold;
}
</style>
</head>
<body>
<form action="" method="post">
<table>
<caption>HTML Form</caption>
<tr>
<td class="common">Name</td>
<td><input type="text" name="name" maxlength="15" /></td>
</tr>
<tr>
<td class="common">Password</td>
<td><input type="password" name="pwd" maxlength="15" /></td>
</tr>
<tr>
<td class="common">Gender</td>
<td><input type="radio" name="sex" value="male"/>Male</td>
<td><input type="radio" name="sex" value="female"/>Female</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="submit"/></td>
</tr>
</table>
</form>
</body>
</html>
thanks