css style echo output

Discussion in 'Programming' started by Manganix, Apr 1, 2013.

to remove all ads.
  1. Manganix

    Manganix Member

    Messages:
    112
    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.";
     
  2. Edge

    Edge Member

    Messages:
    461
    Can you post a URL?
     
  3. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    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.
     
  4. Manganix

    Manganix Member

    Messages:
    112
    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
     
  5. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    #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.
     
  6. Manganix

    Manganix Member

    Messages:
    112
    fixed! THANKS!
     

Share This Page