- This topic has 5 replies, 2 voices, and was last updated 3 years, 7 months ago by
David.
-
AuthorPosts
-
August 16, 2022 at 7:01 am #2314466
Marcel
Hello,
I know how to add additional CSS classes and custom attributes to a container, but I would like to add both additional CSS class(es) and custom attributes to a single word or group of words within a headline (paragraph). Is it possible?
Thank you!
August 16, 2022 at 7:28 am #2314495David
StaffCustomer SupportHi there,
your simplest option is to use a HTML block. And to write the HTML with the class and attributes.
The alternative is to use a PHP Snippet to string replace some of the content with your new HTML. But that depends on what the HTML looks like.
Do you have an example of what HTML should be output ?
August 16, 2022 at 8:06 am #2314705Marcel
Hello David,
I put the address of the experiment I want to do in the private information area. The experiment is based on a tutorial seen on YouTube.
As you can see there, I have three tabs: Events, Groups and Future. You are presented with different content (images) if you click each tab.
Instead of the three tabs, I would like to use the following paragraph: “If you like these kinds of events, join one of our groups to benefit from the member-specific advantages in the future.”
By clicking on “events”, “groups”, or “future”, I would like to get the same result as when you click on tabs, that is, to be able to view the specific content of each tab.
‘Events” tab has:
– HTML Anchor:tab-1;
– Additional CSS class:activeTab;
– Custom Attribute: data-attribute:data-taband value:1Please give me an example of how I could write these in a HTML block.
Thank you a lot!August 16, 2022 at 8:21 am #2314715David
StaffCustomer SupportSo you could try wrapping each word in a
spantag to add the attributes to eg.<div class="your-class">If you like these kinds of <span id="tab-1" class="active-class" data-tab="1">events</span>, join one of our <span id="tab-2" class="" data-tab="2">groups</span> to benefit from the member-specific advantages in the <span id="tab-3" class="" data-tab="3">future</span></div>August 16, 2022 at 9:45 am #2314796Marcel
Thank you, David!
I have made a small donation to show appreciation for your excellent customer support.
All the best,
MarcelAugust 17, 2022 at 2:56 am #2315366David
StaffCustomer SupportThats really kind of you ! Its much appreciated.
-
AuthorPosts
- You must be logged in to reply to this topic.