- This topic is empty.
-
AuthorPosts
-
May 7, 2013 at 10:52 am #44610
mackdoyle
MemberI have a need to target text characters that are being used as separators between list elements. I do not have access to the source but I can inject CSS overrides. If I can find a way to target those characters, I could easily hide them. Targeting them is where I am lost, though.
I created an [example on Codepen](http://codepen.io/mackdoyle/pen/xrLIC “example on Codepen”) to explain the situation.
May 7, 2013 at 10:57 am #134349Paulie_D
MemberIs this existing mark-up & you are trying to fix it?
Not sure how you can target something that indeterminate without an id or class. This feels like, at best, something JS could do by targeting any characters between a close bracket `/>` and an open bracket `<` but even that will run into problems. Frankly, I would just tear it all down and start again
May 7, 2013 at 11:51 am #134350wmwood
ParticipantI’m with @Paulie_D on this one tear it down and start again is optimal.
But, if you must: http://codepen.io/wmwood/pen/zsIik
May 7, 2013 at 11:51 am #134351Justin_G
MemberI know you can inject CSS code before and after certain elements, referenced here: https://css-tricks.com/css-content/
Maybe there is something there to remove nodes? Other than that, I would have to agree with Paulie_D
May 7, 2013 at 11:51 am #134352CrocoDillon
ParticipantThis works:
ul {
position: relative;
left: -1000px;
}
li {
position: relative;
left: 1000px;
}Maybe with overflow: hidden on parent element. Keep in mind though it’s not valid html so some browsers might do funky things and you’ll end up seeing the pipes anyway… maybe.
May 7, 2013 at 11:55 am #134354Paulie_D
Member>But, if you must: http://codepen.io/wmwood/pen/zsIik
This I like…strip it out altogether.
However, if you don’t have access to the source, you can’t inject a JS script.
SOL I’m afraid…AFAIK.
May 7, 2013 at 12:00 pm #134355Paulie_D
Member>I know you can inject CSS code before and after certain elements
Sort of…what you can do is inject stuff **into** elements before and after the **content** of those elements.
What you can’t do is remove content or style stuff outside of that element.
May 7, 2013 at 12:04 pm #134356Merri
ParticipantJust use transparent color and you’re not seeing the text:
.ex-one ul {
color: transparent;
}If you also want to remove the character effect entirely you can use `font-size: 0;` although there is a gotcha: you can’t use `em` in ul’s measurements and you need to use `font-size: medium;` or other means to restore font size in the li elements.
.ex-one ul {
color: transparent;
font-size: 0;
}.ex-one li {
font-size: medium;
margin: 1em 0;
}Also `.ex-two ul:not(li)` makes no sense. You’re matching ul elements that aren’t li elements. So it always matches the ul element and is equivalent to writing `.ex-two ul`.
May 7, 2013 at 12:16 pm #134360Paulie_D
Member>If you also want to remove the character effect entirely you can use font-size: 0;
That doesn’t **remove** it, of course, it’s still there in the source (and thus accessible) but it’s decent idea.
May 7, 2013 at 12:20 pm #134353Merri
ParticipantYup, that is why I used the word effect. You can’t see the text when making selection and elements align as if the text wasn’t there at all, but if you copy’n’paste the text you’ll see the pipes and the text still exists in the DOM tree etc.
May 24, 2013 at 10:08 am #136340mackdoyle
MemberThanks Merri. That does the trick! And yes the reason for hacking it like this is because it is a SaaS product and I only have the ability to inject CSS overrides.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.