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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Forum Members
Forum Members
Posts: 61
Joined: Wed Aug 08, 2018 4:59 pm

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

Post 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

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; } }
User avatar
Dev Team Member
Dev Team Member
Posts: 7759
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands

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

Post by Rolf »


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

Code: Select all

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

Grtz. Rolf
- + - + - + - + - + -
Latest CMSMS tutorial: FormBuilder WatchGuard
- + - + - + - + - + -
Did my post help you solving a problem at your (customers) website and it saved you many hours of work?
Great!! Buy me a cup of coffee in return as a small token of appreciation!

Return to “Layout and Design (CSS & HTML)”