Add a CSS class to Attributes

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #987418
    Marco Elsinger
    Participant

    Hi,

    is it possible to add a custom class to the attributes.
    It would be quite handy as you could display different fontawesome icons instead of the normal info icon. Like a wifi, garage, pool, etc. Would there be a plugin to do that or is that just not an option.

    Thanks

    #987482
    Andre Flores
    Moderator

    Hi, Marco!

    Each attribute has a unique class by default, you may find the exact class name using Inspect Element tool of your favorite browser. Let’s say, the attribute is named “Location”, in this case the CSS class will be
    .mphb-location-title

    Regards,
    Andre

    #988275
    Marco Elsinger
    Participant

    Hi,

    Yes I never thought about it so I’ve been playing arround with this now and what I’m trying to archieve is this:

    li.mphb-room-type-location.mphb-room-type-custom-attribute::before{
    content: “\f3c5”;}

    When I apply the change in the browser it will swaap the icon but when I add it to the custom css in the tempalte the icon is not replaced.

    Any ideas?

    Thanks

    #988299
    Marco Elsinger
    Participant

    Hi,

    Yes I never thought about it so I’ve been playing arround with this and its working now.

    I leave the code below if anyone want to do this in future:

    .mphb-room-type-“your atribute slug”.mphb-room-type-custom-attribute::before{content: “you font awesome icone unicode”;}

    Thanks

    #988355
    Andre Flores
    Moderator

    Hi, Marco!

    Thanks for sharing the code that worked out for you, I am glad that you have managed to resolve the issue.

    Regards,
    Andre

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.