Skip navigation
phpandcss
Currently Being Moderated

how to restyle fonts through echo tags php and html

Feb 12, 2014 5:34 PM

Tags: #php #html

does any have the knowledhe for changing the out put of the echo script to a different font type? <?php echo $data[$i]->artist; ?>

 
Replies
  • Currently Being Moderated
    Feb 12, 2014 5:51 PM   in reply to phpandcss

    <p style="font-family='boohaa sans', arial, helvetica, sans-serif"><?php echo $data[$i]->artist; ?></p>

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 13, 2014 10:35 AM   in reply to phpandcss

    Murray should you one way with inline CSS.  You could simply use a CSS class from your style sheet.

     

    <p class="ClassName"><?php echo $data[$i]->artist; ?></p>

     

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 13, 2014 11:03 AM   in reply to Nancy O.

    That's the better solution for sure - I used inline styles for illustration purposes and should have added this as a disclaimer. Thanks, Nancy O!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2014 3:05 PM   in reply to phpandcss

    Paragraph <p> tags have default browser margins and padding  as do all other HTML elements.  You customize these in your style sheet as required.

     

    .echo {

         margin:0;

         padding:0;

         color:red;

         font-size: 18px;

    }

     

    <p class="echo"> your PHP here...<p>

     

    Or, maybe a list would work better... 

     

    <ul>

         <li> your PHP here....</li>

    </ul>

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2014 3:48 PM   in reply to phpandcss

    Show us an example of this. Generally speaking this cannot happen with plain text whether echoed by PHP or JavaScript or just static text.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points