473,499 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to Prevent parent underline from underlining child element

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. .redunderline {
  5.     color: red;
  6.     text-decoration: underline;
  7. }
  8. .blueoverline {
  9.     color: blue;
  10.     text-decoration:none;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <div class="redunderline">
  16.     This <b>div</b> has text decoration set to underline,
  17.     <span class="blueoverline">but this <b>span</b> has it set to overline.</span> 
  18.     The <b>div</b> continues here.
  19. </div>
  20. </body>
  21. </html>
Aug 1 '12 #1
2 2924
ariful alam
185 New Member
Basically its not possible as the <span></span> is inside the <div></div>. because it works like layer. <span></span> layer inside <div></div> layer. whenever you used text-decoration to none for the <span></span> it's go transparent/hide to show the <div></div>'s settings.
Aug 1 '12 #2
Bharat383
93 New Member
use this code

div.redunderline {}

span.blueunderline{}
Sep 5 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
11578
by: Christopher Benson-Manica | last post by:
I have an HTMLInputElement in a <td>. I want to access all the <td>'s in the same row as the input element. var tr=theInputElement.parentNode.parentNode; Why isn't the input element's...
2
2909
by: Rob T. | last post by:
Given the following in a stylesheet: #parent { width: 50px; height: 50px; } #child {
0
1083
by: clintonG | last post by:
The implementation I am working with has several child elements that have the same name; <link> for example. When the XML is loaded into a tree control and a click event is used on a node in the...
3
3930
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child...
2
23478
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
4
2892
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
1
5647
by: Eric | last post by:
I want to call a method on the MDI parent from the child. Basically the method will set some text (message) on a status strip and show the appropriate icon (for the type of message). I'd also...
3
9614
by: rlueneberg | last post by:
I want to change the color of an "a" child element inside a table cell via javascript. Is there any way to do that? Ps: there is no id assigned to child elements. I would like to discover the child...
1
2569
by: bhargavi ramineni | last post by:
I have used the following javascript code to get a child window for parent window. childWin...
7
12349
by: dweeti | last post by:
Hi, I am trying to display the child element in the DOM, while hiding the parent using JS and CSS, however I cannot find a way to do this. So for example: <body> <div id="Parent"> <div...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.