21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 292 Views |
-
Variables and inline CSS

13 July 2011 at 2:24am
Hello. This might be a stupid one, but, well, I'm stupid.
I have the following code in one of my template files:
<div id="EventTitleHeader" style="font-size:30px">
$eventtitle
</div>I want to make the title of the site controllable in the CMS (variable $eventtitleSize) so I added the following code:
<div id="EventTitleHeader" style="font-size:$eventtitleSizepx">
$eventtitle
</div>As you can guess this doesn't work cause the variable is now part of the 'px' value. Unfortunately adding a space will result in the CSS not working either. Is there a workaround for this?
-
Re: Variables and inline CSS

13 July 2011 at 2:30am
Put braces around the variable e.g. style="font-size:{$eventtitleSize}px"
-
Re: Variables and inline CSS

13 July 2011 at 2:40am
Thank you!! I knew it would be something like that!
| 292 Views | ||
|
Page:
1
|
Go to Top |


