Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Css on a <div>

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
jaimeZesis
Smarty n00b


Joined: 07 Sep 2017
Posts: 1

PostPosted: Thu Sep 07, 2017 8:20 am    Post subject: Css on a <div> Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Sep 07, 2017 5:25 pm    Post subject: Reply with quote

I don't see how is this related to Smarty. Please rephrase your question.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Thu Sep 07, 2017 10:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP