Page 1 of 1

Is it possible to add a CSS class to a Smarty tag???

Posted: Thu Aug 09, 2018 9:53 am
by Sendlingur
Hi all, I just starting to use CMSms few days ago. I have a previous experience in html/css/javascript.

I need to know if it is possible to add a simple css class to a smarty tag so the <a> tag has a CSS class when the browser renders it.

this is the Smarty tag that need the class

Code: Select all

{$entry->morelink}
I have tried everything I have thought of but nothing seems to work.

the output must be something like

Code: Select all

<a href="someurl" class="link">see more</a>


here is the style in .link which I need to add to the "see more" link somehow. Otherwise the link styling is not working.

Code: Select all

  .main-banner figcaption .box .link {
        font-size: 20px;
        font-weight: 500;
        color: inherit;
        display: inline-block;
        vertical-align: top; }
        .main-banner figcaption .box .link:hover {
          text-decoration: underline; }
        @media (max-width: 767px) {
          .main-banner figcaption .box .link {
            font-size: 18px; } }

Re: Is it possible to add a CSS class to a Smarty tag???

Posted: Thu Aug 09, 2018 10:57 am
by Rolf
Hi,

Beside {$entry->morelink}, there is {$entry->moreurl}.

Code: Select all

<a href="{$entry->moreurl}" class="link">see more</a>
Hope this helps.

Grtz. Rolf