Page 1 of 1

replace small tag with pixel size

Posted: Mon Aug 04, 2008 5:36 pm
by dustyyy
can someone help me replace the <small> tag with a pixel size using an array?

Code: Select all

array("1"=>"10px","2"=>"8px");  
the key being the amount of consecutive <small> tags and value their pixel equivalent. the array is optional if there is another way to hold the conversion information.

for example:

Code: Select all

<small>hello world</small> would print at 10px
<small><small>hello world</small></small> would print at 8px
thanks for any help you can provide!

Re: replace small tag with pixel size

Posted: Mon Aug 04, 2008 5:47 pm
by manixrock
The <SMALL> tag is shorthand for <FONT SIZE="-1">. The sizes vary a lot accross browsers and OS's. A table sowing them can be found here: http://www.netmechanic.com/news/vol3/design_no8.htm.

Re: replace small tag with pixel size

Posted: Mon Aug 04, 2008 6:00 pm
by dustyyy
thanks but i'm actually looking for a php function to replace the small tag using the specified array. where 1 small tag would equal 10px and 2 small tags would equal 8px.

Re: replace small tag with pixel size

Posted: Mon Aug 04, 2008 7:04 pm
by RobertGonzalez
That makes no sense. 10px worth of what? How would PHP do that for you?

If you have <small> set a css rule that it has to be certain dimensions. If you have a <small> with a descendant <small> have a CSS rule for that too. There is nothing in PHP that you would need to do this with.