text-decorations

Why does display: inline-block; remove an underline from a child element?

最后都变了- 提交于 2019-11-27 06:02:38
问题 Recently I answered a question and the OP wanted text-decoration: underline; for the entire text wrapped inside the a element, but not the one wrapped inside span , so it was something like this <a href="#"><span>Not Underline</span>Should Be Underlined</a> So simply giving span { text-decoration: none; } doesn't remove the underline for the text wrapped inside a span element But this does remove the underline span { text-decoration: none; display: inline-block; } So I made the span an inline

Inherited Text-Decoration style

半腔热情 提交于 2019-11-27 05:59:19
问题 How would I negate or remove a parents text-decoration style? For example in the following, both the text and the anchor have a text-decoration of line-through, is there a way to not have that applied to the anchor tag? <span style="text-decoration:line-through;"> Dead Text <a href="#" style="text-decoration:underline;color:Red;">Not Dead Text</a> </span> NOTE: wrapping the inner text in a span isn't an easy option with what I have so I'm looking for a solution based on the css styles if

CSS text-decoration underline color [duplicate]

旧街凉风 提交于 2019-11-26 18:38:01
Possible Duplicate: Changing Underline color It's possible to change only line color which is under text? I would like to see something like red letters with a blue line below it, but I can't find out how to get this done. Rob (for fellow googlers, copied from duplicate question ) This answer is outdated since text-decoration-color is now supported by most modern browsers. You most likely need this, by setting your word with a border-bottom. a:link { color: red; text-decoration: none; border-bottom: 1px solid blue; } a:hover { border-bottom-color: green; } Cherusker You can do it if you wrap

How do I get this CSS text-decoration override to work?

孤街醉人 提交于 2019-11-26 03:15:20
问题 Some days I swear I\'m going mad. This is one of those days. I thought my CSS was fairly straight-forward here, but it just doesn\'t seem to be working. What am I missing? My CSS looks like this: ul > li { text-decoration: none; } ul > li.u { text-decoration: underline; } ul > li > ul > li { text-decoration: none; } ul > li > ul > li.u { text-decoration: underline; } And my HTML looks like this: <ul> <li>Should not be underlined</li> <li class=\"u\">Should be underlined <ul> <li>Should not be