Change fonts in accordeon CSS
-
Hi everyone
I want to change the fonts in the accordeon CSS code that Amir wrote. Have I got it right I need to do this in this line?
<div class="accordion-title lay-textformat-parent">.
I have already created a font in the Wordpress "Text Formats". The HTML class is called _accordion_title.
Can I use this HTML_Class or do I need to change the fonts somewhere else?
All the best and thanks
Dennis
-
Does anyone know how to change fonts in Amir's accordion CSS code?
-
i dont know which code you mean, do you have a link or can you post the code here
if you can change the html code, you can just add class="_accordion_title" to some container or insert _accordion_title into an existing class attribute
-
Sure. I put this in the "Custom CSS & HTML" under Custom <head> content:
<script>
window.laytheme.on('newpageshown', function(){
jQuery(".accordion-title").on("click", function(){
jQuery(this.parentNode).toggleClass("active")
})
})
</script>
<style>
.accordion-title{
cursor: pointer;
}
.accordion .minus, .accordion .plus{
margin-left: 30px;
}
.accordion .minus{
display: none;
}
.accordion .accordion-content{
display: none;
margin-top: 20px;
}
.accordion.active .minus{
display: inline;
}
.accordion.active .plus{
display: none;
}
.accordion.active .accordion-content{
display: block;
}
.accordion-title{
display: inline-block;
}
</style>
And this in a "Edit HTML" on a project site:
<div class="accordion">
<div class="accordion-title lay-textformat-parent">
<span>Chris Leuenberger & Marcel Schwald</span>
<span class="plus">+</span>
<span class="minus">-</span>
</div><div class="accordion-content lay-textformat-parent"> <p>Chris Leuenberger und Marcel Schwald haben s.....</p> <p><br><a href="https://www.marcelschwald.com/">www.marcelschwald.com</a><br><a href="https://chrisleuenbergerproductions.com">https://chrisleuenbergerproductions.com</a></p> </div></div>
-
<div class="accordion-title _accordion_title">
-
THX it worked.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login