Jump to content

CSS and PHP


jermaindefoe

Recommended Posts

I have a page that currently is populating some information from a database and turning it in to links to another page

 

for this i am using a while loop with  mysql_fetch_array

 

and generating the links in this. However the output then is with the links really tightly packed one after the other, so i thought i would use some css to try and make it look better

 

How can i add css in to this as its in the php code isnt it?

 

thanks guys

Link to comment
https://forums.phpfreaks.com/topic/181022-css-and-php/
Share on other sites

Even though the code that's generating the links is written in PHP, its outputting HTML.  Simply use what you would for straight HTML with CSS - an id or class that a stylesheet can grab a hold of, or an inline style.  Example:

 

while($val = mysql_fetch_assoc($values))
{
   echo "<a href='newpg.php?id=" . $val['key'] . "' class='links'>" . $val['itsType'] . "</a><br />";
}

Link to comment
https://forums.phpfreaks.com/topic/181022-css-and-php/#findComment-955084
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.