um... you needed perl help right? or do you need html help? i was asking for the perl source code... cant fix the problem if i cant see it. your link is to generated html, so i have no idea if you need html tweaks or if there's some nasty perl bug causing hiccups.
im having some trouble adding background image & changing font & size here
Perl has nothing to do with changing font and size in HTML. Perl is a server-side scripting language that spits out the HTML (and possibly CSS) to the browser; it doesn't directly control styling itself.
You need to sit down with an HTML & CSS intro book for an afternoon before you get into Perl.
unless he's changing font size, color, and backgrounds with perl before the html is sent client side. still could be a perl issue....
that being said.. keebs makes mention of a wonderful bit of technology called css. you could be outputting html from perl but using css to control the look and feel of your end result. might be easier than hard coding colors and font sizes in your script.
print "grade 1 is $grade\n<br>";
print "grade 2 is $grade2\n<br>";
print "grade 3 is $grade3\n<br>";
print "grade 4 is $grade4\n<br>";
print "grade 5 is $grade5\n<br>";
print "grade 6 is $grade6\n<br>";
print "the average of all the grades is $average\n<br>";
print "3 cubed is $cubedgrade<br>";
print "one more than the cubed grade is $onemore<br>";
print "The remainder is $remainder<br>";
############################
if($average >= 93){
print "<font color=blue>hey you got an A!";
print "</font><br>";
}
elsif($average >= 82) {
print "<font color=orange>hey you got a B";
print "</font><br>";
}
elsif($average >= 70) {
print "<font color=purple>hey you got a C";
print "</font><br>";
}
elsif($average >= 65) {
print "<font color=green>hey you got a D";
print "</font><br>";
}
elsif($average <= 64) {
print "<font color=brown>hey you got a F";
print "</font><br>";
}
You didn't wrap the code in "PHP" or "code" tags, so the forum converted the HTML to VB code and it's unreadable now. I strongly suspect this is not a Perl problem, it's an HTML problem (you're printing incorrect HTML, not screwing up Perl code).
You didn't wrap the code in "PHP" or "code" tags, so the forum converted the HTML to VB code and it's unreadable now. I strongly suspect this is not a Perl problem, it's an HTML problem (you're printing incorrect HTML, not screwing up Perl code).
oops thx keeb ok code & PHP didn't seem to help either so ive uploaded it as notepad attachment any help on getting BG image & different font style/size using CSS would be helpful:)
When you assign an attribute to an HTML tag like color, the value needs to be in quotes. So it's:
< font color="green" >
NOT:
< font color=green >
However, like I said, you should never, ever use the font tag. Use CSS. I can't teach you CSS in a forum post - I highly recommend the linked book above if you're going to continue making websites. Trying to tackle Perl before learning HTML/CSS is totally backwards.
yeah keebs is right... it's not perl per se you're having a problem with. being more familiar with the fundamentals of html syntax and structuring will help you a ton in the long run... it's not too difficult. once you can do html/css pretty well then webapps will come together much easier for you.
If you want to embed CSS in the same document, you need to put it in the document head inside < style > tags. Seriously... you need a reference and/or tutorial book for this.
Comments
You need to sit down with an HTML & CSS intro book for an afternoon before you get into Perl.
Pro tip: Never, ever use the "font" tag. Ever.
that being said.. keebs makes mention of a wonderful bit of technology called css. you could be outputting html from perl but using css to control the look and feel of your end result. might be easier than hard coding colors and font sizes in your script.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title> Grades</title></head> <body>";
print "<body bgcolor=yellow>\n";
$grade = 67;
$grade2 = 75;
$grade3 = 67;
$grade4 = 75;
$grade5 = 70;
$grade6 = 65;
$average = ($grade + $grade2 + $grade3 + $grade4 + $grade5 + $grade6) / 6;
$cubedgrade = 3 ** 3;
$onemore = $cubedgrade + 1;
$remainder = #onemore % 3;
print "grade 1 is $grade\n<br>";
print "grade 2 is $grade2\n<br>";
print "grade 3 is $grade3\n<br>";
print "grade 4 is $grade4\n<br>";
print "grade 5 is $grade5\n<br>";
print "grade 6 is $grade6\n<br>";
print "the average of all the grades is $average\n<br>";
print "3 cubed is $cubedgrade<br>";
print "one more than the cubed grade is $onemore<br>";
print "The remainder is $remainder<br>";
############################
if($average >= 93){
print "<font color=blue>hey you got an A!";
print "</font><br>";
}
elsif($average >= 82) {
print "<font color=orange>hey you got a B";
print "</font><br>";
}
elsif($average >= 70) {
print "<font color=purple>hey you got a C";
print "</font><br>";
}
elsif($average >= 65) {
print "<font color=green>hey you got a D";
print "</font><br>";
}
elsif($average <= 64) {
print "<font color=brown>hey you got a F";
print "</font><br>";
}
print "This is the end";
oops thx keeb ok code & PHP didn't seem to help either so ive uploaded it as notepad attachment any help on getting BG image & different font style/size using CSS would be helpful:)
< font color="green" >
NOT:
< font color=green >
However, like I said, you should never, ever use the font tag. Use CSS. I can't teach you CSS in a forum post - I highly recommend the linked book above if you're going to continue making websites. Trying to tackle Perl before learning HTML/CSS is totally backwards.
good luck.