Styling PHP using CSS

Hi there.

I have a PHP echo that contains an anchor tag.

I also have an a class that I want to use to style this anchor tag. Unfortunately I do not know where to place the tag within the php echo.

Could anyone give me an idea. My php code is as follows:

[php]<?php echo' '. truncate($row['message']) .' ';?>[/php]

Thank you in advance.

You can place the class tag wherever you want inside the anchor tag. You need to understand that PHP will happen server-side so the anchor tag will appear as regular HTML to CSS

Also instead of escaping the single quotes you may use double quotes instead…
[php]

<?php echo' '. truncate($row['message']) .' ';?>

[/php]

Thanks for that Mdahlke.

Just what I was looking for.

Will test it when I get home and let you know how it goes.

I always end up putting the quotes in the wrong places.

Thanks again.

Hi Mdahlke.

Thanks for the advice.

Got it working in no time.

Cheers mate.

Sponsor our Newsletter | Privacy Policy | Terms of Service