Hi, experts,
I am learning how to use css files. And the following is a simple example I wrote:
html file (created by perl+cgi.pm):
css file:
Here are my questions:
1) The color of 'First Name' is blue, which is expected. However, it's font is NOT 'Arial, Helvetica, sans-serif', which is NOT expected. How to fix this? I know I can use <span> tag to do the job. But I don't understand why 'body{}' in the css file would not work on it.
2) How do I change the color of the 'Submit' button and the user inout text area to the same as the rest, i.e. 'darkcyan' as defined in 'body{}' in the css file?
Thank you.
I am learning how to use css files. And the following is a simple example I wrote:
html file (created by perl+cgi.pm):
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"[URL unfurl="true"]http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="en-US">
<head><title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="/styles/msf_style.css" />
</head>
<body bgcolor="F5F4EB">
<center><h3>Registration Form</h3></center>
<form method="post" action="saveUserInfo.pl" enctype="multipart/form-data" name="theForm">
<table width="50%" align="center" border="1">
<tr>
<td align="left">
<table width="100%" align="left">
<tr>
<td align="left" colspan="2">
<b>Tell us about yourself (The fields with <span class='star'>*</span> are required).</b>
</td>
</tr>
<tr>
[b]<td align="right"><span class="star">* </span> First Name: </td>[/b]
<td align="left"><input type="text" name="fname" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><input type="submit" name=".submit" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
css file:
Code:
h3{font-family: Arial, Helvetica, sans-serif; font-size: 18pt; color: black}
body {background-color: darkcyan; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: blue}
.star{font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: red}
Here are my questions:
1) The color of 'First Name' is blue, which is expected. However, it's font is NOT 'Arial, Helvetica, sans-serif', which is NOT expected. How to fix this? I know I can use <span> tag to do the job. But I don't understand why 'body{}' in the css file would not work on it.
2) How do I change the color of the 'Submit' button and the user inout text area to the same as the rest, i.e. 'darkcyan' as defined in 'body{}' in the css file?
Thank you.