473,549 Members | 3,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Underlining text using CSS

8 New Member
Hi, I am new to the forum.

I wanted to know if there's any way in which I can underline a phrase in a webpage using CSS. I tried using "text-decoration:unde rline;" but it looks like that works only with hyperlinks. Any suggestions/advice is greatly appreciated.

Thanks...
Mar 30 '07 #1
3 1468
AricC
1,892 Recognized Expert Top Contributor
Hi, I am new to the forum.

I wanted to know if there's any way in which I can underline a phrase in a webpage using CSS. I tried using "text-decoration:unde rline;" but it looks like that works only with hyperlinks. Any suggestions/advice is greatly appreciated.

Thanks...
That is the correct syntax.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.     <html>
  3.         <head>
  4.             <title>Coming...</title>
  5.                 <style type="text/css">
  6.                 .clsUnderline
  7.                 {
  8.                  text-decoration: underline
  9.         }   
  10.                 </style>
  11.         </head>
  12.             <body>
  13.                <div class="clsUnderline">
  14.                     TEXT TEXT TEXT TEXT TEXT TEXT 
  15.                </div>
  16.             </body>
  17. </html>
  18.  
Mar 30 '07 #2
KevinADC
4,059 Recognized Expert Specialist
It should work for just about any text:

<h1 style="text-decoration: underline">hell o world</h1>
<div style="text-decoration: underline">the text in the div</div>
etc
etc
etc
Mar 30 '07 #3
Manil
8 New Member
thanks all for replying. I used your advise and it worked!
Jun 25 '07 #4

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

Similar topics

0
1605
by: Gilles Kuhn | last post by:
I'm using fop and I would like to underline spaces, even those located out of the character string. To illustrate the problem, let's have a look at this: xml doc: <page> <line>(<u> abc </u>)</line> </page> I would like the result of xsl:fo transformation to be:
2
2255
by: Franklin P Patchey | last post by:
<P><A style="COLOR: rgb(0,0,0); FONT-SIZE: 80%; FONT-FAMILY: 'Comic Sans MS', cursive; TEXT- ALIGN: left" href="javascript:self.close();"><FONT size=4><STRONG>Close this window!</STRONG></FONT></A></P>
16
1974
by: Stoic | last post by:
Hi, I'm relatively new to CSS. I'm trying to get all the urls in a group of text bracketed by <p></p> tags to be underlined and everywhere else to NOT be underlined. As of now my code is like this... A {color: #003366; font-size: 14px; text-decoration: none;} Which solves the second requirement but not the first. I don't want to have to...
15
16199
by: Mason A. Clark | last post by:
I have a page with many links. Browsers like to underline the links -- result is ugly. Is there any (CSS?) way to prevent underlining? (By the way, I decry the common practice of making links hard to see -- at least color them.)
6
2365
by: Henry | last post by:
How can I change the text in a link, originally displayed with the "text-decoration:none" attribute to display an underline during the onMouseOver event, and back to its original (non-underlined) state for the onMouseOut? I'm pretty sure that it's of the format document.<itemname>.attribute = value but beyond that I'm not sure, and I...
1
2911
by: ReidarT | last post by:
How can I underline the first letter in a label in a webform to indicate that the accesskey is the one underlined? Do I have to make to labels and position them side by side? regards reidarT
3
2641
by: DC | last post by:
Given: a { text-decoration:none; } a:hover { text-decoration:underline; }
0
1114
by: pdreid | last post by:
Hi there. I am having an issue with one of my access forms. When the Is Hyperlink property is set to yes, underlining Yes and color blue. The link still only shows up with Blue writing and the hyperlink works, however it is not underlined. Does anyone know why this is?
2
2145
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi I have a repeater control as shown below. The Itemtemplate contains a table with linkbuttons in each column of the row. However I wish to change the stlyle of the link button to text-decoration:underline on mouseover and text-decoration:none on mouseout The link button does not have a mouseover attribute and it won't let me add on Any...
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7718
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.