Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to replace "from tumblr" with just "tumblr", using CSS, if possible. I'm afraid to edit it with Notepad++ because last time I broke something and now I have a trauma.

HTML class is:

<option value="has(span[title^=xtumblr_'])">from tumblr</option>

It's from a selectable field.

How would I achieve that?

share|improve this question
you have static content? then yeah, replace it permanently, don't let the client browser do something you can do yourself. perhaps search for >from tumblr</option> to replace to >tumblr</option> – ericosg Apr 23 at 16:11
Why? Why why why why why would you do that. Why. – Mathletics Apr 23 at 16:11

1 Answer

Unfortunately no, CSS has no power to distinguish individual words (though there are pseudo-elements ::first-letter and ::first-line), and it's difficult to reliably style the select, and child option, elements with CSS.

With JavaScript this is possible, but editing (and this time carefully) in any text-editor, and certainly with Notepad++, is just as (if not far more) reliable.

share|improve this answer
Thanks. The problem is I know how to replace it with NotePad++. But the script gets updated regularly. Last time I fixed a script to fit my own personal preferences it was updated the other day and I couldn't run it. I can't to this day, even if I delete and redownload it from Chrome. – Swift Try Apr 23 at 16:17
What 'script'? The HTML file, or a JavaScript file? If you're regularly making changes then the solution is to use a dynamic server-side solution to automate the changes (where, and if, possible) rather than hard-coding the changes every time. Either way: it remains impossible with CSS (and frankly changing the CSS every time you want to add, change or remove your option values is unmaintainable anyway. – David Thomas Apr 23 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.