Forum Moderators: not2easy

Message Too Old, No Replies

Custom CSS, REUSED HTML Markup

Customising PHP output using CSS...

         

takuhii

11:10 am on Dec 17, 2007 (gmt 0)

10+ Year Member



I have some PHP which spits out the following HTML Markup:


<ol class='addressbook-list'>
<li class='addressbook-item'>
<span class='name'>Username</span>
<a class='email' href='mailto:#*$!xx@#*$!xx.co.uk'>userEmail</a>
<span class='phone'>userPhone</span>
<div class='address'>
<span class='address-line1'></span>
<span class='suburb'></span>
<span class='postcode'></span>
<span class='state'></span>
<span class='country'></span>
</div>
<div class='notes'>UserNotes</div>
</li>
</ol>

My question is this, can I apply different CSS styles to this code (somehow) as it is spat out, or do I need to re-engineer my PHP (and probably shift this to the PHP forum)?

SuzyUK

3:29 pm on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi takuhii

Yes you can apply your own CSS to that code - have you got an existing stylesheet?

each portion of the code has already been classified (got a classname attached), in fact there's probably too many classes, but at least that means you should be able to explicitly target and style the list pretty much anyway you like, without having to change the PHP/HTML

If you haven't got a stylesheet and are wondering about the actual styling / selector syntax you might use then let us know, as that will be a CSS question rather than a PHP one

hth
Suzy