KDragon Posted April 23, 2006 Share Posted April 23, 2006 Why isn't the text this document displays, white? I have a variable representing each value of the rgb specification of the color white. I set the variable to 255 but the text always shows up black. Can anybody please explain why? Here's the code:[code]<?php $colorNum=255; ?><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><p style="color: rgb(<?php $colorNum; ?>,<?php $colorNum; ?>,<?php $colorNum; ?>);">This be some text.</p></body></html>[/code] Quote Link to comment Share on other sites More sharing options...
mb81 Posted April 23, 2006 Share Posted April 23, 2006 [!--quoteo(post=367613:date=Apr 23 2006, 12:59 AM:name=KDragon)--][div class=\'quotetop\']QUOTE(KDragon @ Apr 23 2006, 12:59 AM) [snapback]367613[/snapback][/div][div class=\'quotemain\'][!--quotec--]Why isn't the text this document displays, white? I have a variable representing each value of the rgb specification of the color white. I set the variable to 255 but the text always shows up black. Can anybody please explain why? Here's the code:[code]<?php $colorNum=255; ?><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><p style="color: rgb(<?php $colorNum; ?>,<?php $colorNum; ?>,<?php $colorNum; ?>);">This be some text.</p></body></html>[/code][/quote]My bet would be that if you view the source of the file, it will look like this:[code]<p style="color: rgb(,,);">This be some text.</p>[/code]Change your line to this:[code]<p style="color: rgb(<?php echo $colorNum; ?>,<?php echo $colorNum; ?>,<?php echo $colorNum; ?>);">This be some text.</p>[/code]and it should work. Quote Link to comment Share on other sites More sharing options...
KDragon Posted April 23, 2006 Author Share Posted April 23, 2006 [!--quoteo(post=367618:date=Apr 23 2006, 01:31 AM:name=mb81)--][div class=\'quotetop\']QUOTE(mb81 @ Apr 23 2006, 01:31 AM) [snapback]367618[/snapback][/div][div class=\'quotemain\'][!--quotec--]My bet would be that if you view the source of the file, it will look like this:[code]<p style="color: rgb(,,);">This be some text.</p>[/code]Change your line to this:[code]<p style="color: rgb(<?php echo $colorNum; ?>,<?php echo $colorNum; ?>,<?php echo $colorNum; ?>);">This be some text.</p>[/code]and it should work.[/quote]Oh gosh I'm dumb. I'm sorry :(. My brain must be totally just ahhh today. Thank you for your help. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 23, 2006 Share Posted April 23, 2006 Unless you change the backgroud-color of the body, this text will not be seen.Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.