I have the following code. Only the first line of echo’d text in the function showRegistrationForm() gets my Arial, sans-serif font style.
However the ‘color’ in both the ‘body’ and the ‘form’ tag’s style works fine. The first line is red and san-serif.
But all the text in the form, while it does pick up the blue color style, is a serif’d Courier font!
Only the first line that says “Please provide the following info — a ‘*’ denotes a required field.”
is showing up with a Sans-serif font.
NOTE: strangely though, the ‘color’ style WORKS fine — the “Please provide…” line is red, and the form text is blue.
Only the sans-serif font style goes away — all the text inside the form is a courier-looking serif’d font.
NOTE: I see the same ‘only the first line is sans-serif’ if I get rid of the ‘form’ style tag. When only the ‘body’
style tag is present, all the text is red but again ONLY the first line of text is san-serif, the rest is Courier text in all the form’s text.
Why?
<html>
<head>
<style>
body
{
color: rgb(255,0,0);
font-family: Arial, sans-serif;
}
form
{
color: rgb(0,0,255);
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<?php
showRegistrationForm();
function showRegistrationForm()
{
echo "Please provide the following info -- a * denotes a required field.";
echo '<br /><form action="newUserRegistration.php" method="post">';
echo '<br />Screen name * : <input type="text" name="screenName" />';
echo '<br />First name : <input type="text" name=$firstNameLabel />';
echo '<br />Last name * : <input type="text" name=$lastNameLabel />';
echo '<br />Phone : <input type="text" name=$phoneLabel />';
echo '<br />Email * : <input type="text" name=$emailLabel size=40 />';
echo '<br /><input type="submit" name="addNewRegUserBtn" value="Register Now!" />';
echo '<br /></form>';
}
?>
</body>
</html>
You have the
<pre>tag in use. Delete that and it should work