|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jaimeZesis Smarty n00b
Joined: 07 Sep 2017 Posts: 1
|
Posted: Thu Sep 07, 2017 8:20 am Post subject: Css on a <div> |
|
|
I need to add to a <div> some styles. I'm trying to do it as on html:
<div class="className" style="styles">
but nothing happend. The file has .tpl extension.
Any solutions?? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Sep 07, 2017 5:25 pm Post subject: |
|
|
I don't see how is this related to Smarty. Please rephrase your question. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Thu Sep 07, 2017 10:56 pm Post subject: |
|
|
The template would need to be coded as:
Code: | <div class="className" style="{$MY_STYLES}"> |
Then, in your PHP code that develops the actual styling, you would have:
Code: | $custom_styles = "border: red 3px solid;"
$objSmarty->assign('MY_STYLES',$custom_styles); |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|