Display span target element as block when extended only
-
Hi everyone,
I am new here so I apologize for my ignorance. I’m seeking your help because I am facing a target display issue (here : https://datadrama.info/2016/11/21/trumpsondages/). I am using collapse-o-matic triggers inline inside paragraphs. Tag and Targtag attriutes as set as span and I have this special styling for the trigger and target :
.my_trigger { background-color: #e4e7f5 !important; padding-bottom:1px !important; } .my_trigger:hover { text-decoration: none !important; background-color: #b9c1e5 !important; padding-bottom:1px !important; } .backtarg { border: .1em solid #acb5e0 !important; ; margin: 5px !important; padding-bottom:10px !important; padding-top:10px !important; padding-right:10px !important; padding-left:10px !important; margin-right:0px !important; margin-left:0px !important; }
So my shortcode looks like this :
[expand title=”Title” trigclass=”my_trigger arrowright” targclass=”backtarg”]Target text[/expand]Everything works fine except I would like to justify the paragraph containing my span. When I do so, everything appears fine when the collapsible element in hidden. But in extended mode, the trigger text appears distended (i.e extended on one line) above the target text (because it inherits the text-align: justify style of the paragraph).
I figured via firebug that one way to avoid this could be to change the display property of the (span) target element, from the default display: inline-block to display: block. (I cannot simply set the target as div because it breaks my containing paragraph in two, before and after the div).
Anyway, I can’t figure how to change this display property of the target element when extended only. When I add display: block to my custom .backtarg class, it displays my target the way I want it, but the target is always extended (and not hidden by default as I want it to be).
I would like to achieve this result while still having a hidden target before clicking the trigger text.
Is it even doable ?
Thanks in advance !
- The topic ‘Display span target element as block when extended only’ is closed to new replies.