css style echo output

Manganix

Member
hi,

the [ back ] echoes always in the same blue color, no matter what I try in CSS. I want it to echo in white, could anyone help with the code? Thanks already!

PHP:
echo "Please go <a href='javascript:history.go(-1)'>[ back ]</a> and try again.";
 

chrishirst

Well-Known Member
Staff member
It is simply a <a>nchor element and will be styled as such, to change that, you would do EXACTLY what you would do to style ANY element, and that is:

Give it an id or a class attribute along with an appropriate style rule.
 

Manganix

Member
doesn't work! tried various things:

PHP:
echo "Please go <a href='javascript:history.go(-1)' ><div id="echoBack">[ back ]</div></a> and try again.";
this one gives an error in the code because of the quotes "echoBack"

PHP:
echo "Please go <a href='javascript:history.go(-1)' ><div id=echoBack>[ back ]</div></a> and try again.";
doesn't work

PHP:
echo "Please go <a href='javascript:history.go(-1)' ><div id=\"echoBack\">[ back ]</div></a> and try again.";
doesn't work

The [Back] remains ugly blue, although I style it in the CSS sheet with ID #echoBack

could you advice? Thanks.

PS: try posting a comment here with a wrong captcha or none
http://www.gamanga.com/Trailers.php
 

chrishirst

Well-Known Member
Staff member
#guestbook a {
Rules

}

And it probably doesn't help that the document is completely broken after the error occurs

HTML:
	<div id="Talk_about_trailers"><p>talk about your favorite videogames & stuff (trailers, previews, announcements, ...)</p></div><!--div Talk_about_this_Game-->
    
    <div id="guestbook">	<p>
The security code entered was incorrect.<br /><br />Please go <a id="ehoBack" href='javascript:history.go(-1)' >[ back ]</a> and try again.

THE END OF THE DOCUMENT SOURCE IS HERE.
 
Top