Solved

Apply a style class to a php echo

Posted on 2008-06-26
5
262 Views
Last Modified: 2010-04-21
Hi experts,

I need to apply my font formatting class 'ranking2' to the output of this php script. Please can you tell me how I need to add the html to get the the php echo formatted with the 'ranking2' class.
$newText = $row_currentBlog['BlogEntry'];
$newText .=  "<BR class=\"ranking2\">"."This entry was recorded at: ".$blogdate."<BR>".$blogentry."<BR>";

Open in new window

0
Comment
Question by:RowdyBurns
  • 2
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21873280
you mean, you are looking for how to defined the ranking2 class (css style) in your html document?
0
 

Author Comment

by:RowdyBurns
ID: 21873556
No. I can add the CSS class to the echo in the html document, but this is applied to the all of the echo. What I am trying to do is to format the text "This entry was recorded at:" and the .$blogdate.  before it is echoed in the html because the .$blogentry. needs to formatted differently.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 21873561
Try this...
$newText = $row_currentBlog['BlogEntry'];
$newText .=  "<br /><span class=\"ranking2\">"."This entry was recorded at: ".$blogdate."<br />".$blogentry."</span><br />";

Open in new window

0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 125 total points
ID: 21873573
Oh, new criteria... OK, try this...
$newText = $row_currentBlog['BlogEntry'];
$newText .=  "<br /><span class=\"ranking2\">"."This entry was recorded at: ".$blogdate."</span><br />".$blogentry."<br />";

Open in new window

0
 

Author Closing Comment

by:RowdyBurns
ID: 31470907
The second one nailed it! Thanks lot lot for your help Paseur.
You have a good day.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question