How to disable CSS style relatively to a certain parent tag?

css, html

Solution

Try this

<!DOCTYPE html>
<html>
<style>span {text-decoration: none;display: inline-block;}</style>
<body>
<a href="#">underscored text <span>without underscore</span></a>
</body></html>​

Link to original answer : https://stackoverflow.com/a/10478962/662250

Working fiddle

Problem

This is my HTML: ``` <!DOCTYPE html> <html> <style>span {text-decoration: none}</style> <body> <a href="#">underscored text <span>without underscore</span></a> </body></html> ``` The `<span>` remains underscored. What is a possible workaround (without JavaScript and without changing the HTML)?

Original source

Related problems