943,822 Members | Top Members by Rank

Ad:
Aug 26th, 2009
0

Unordered Lists

Expand Post »
Is there a way to make links in unordered lists be non-underlined by default? And when the user hovers over the link, it becomes underlined?

Here's the current code:
HTML and CSS Syntax (Toggle Plain Text)
  1. <ul>
  2. <li><a href="water">Water</a></li>
  3. <li><a href="wastewater">Wastewater</a></li>
  4. <li><a href="surveying">Surveying</a></li>
  5. <li><a href="aerial">Aerial</a></li>
  6. <li><a href="it">Technology Consulting</a></li>
  7. </ul>

On the page with the lists, all of the links are underlined by default and the underline goes away when you hover over it. We want the opposite of this.
Similar Threads
Reputation Points: 817
Solved Threads: 32
Nearly a Posting Virtuoso
Duki is offline Offline
1,474 posts
since Jun 2006
Aug 26th, 2009
0

Re: Unordered Lists

Duki,
I have listed two cases for the hovers. use what you really need off

case 1:
HTML and CSS Syntax (Toggle Plain Text)
  1. <style>
  2. #hover li a {
  3. text-decoration:underline;
  4. }
  5. #hover li a:hover {
  6. text-decoration:none;
  7. }
  8. </style>
  9. <ul id="hover">
  10. <li><a href="water">Water</a></li>
  11. <li><a href="wastewater">Wastewater</a></li>
  12. <li><a href="surveying">Surveying</a></li>
  13. <li><a href="aerial">Aerial</a></li>
  14. <li><a href="it">Technology Consulting</a></li>
  15. </ul>

case 2:

HTML and CSS Syntax (Toggle Plain Text)
  1.  
  2. <style>
  3. #hover li a {
  4. text-decoration:none;
  5. }
  6. #hover li a:hover {
  7.  
  8. text-decoration:underline;
  9. }
  10. </style>
  11. <ul id="hover">
  12. <li><a href="water">Water</a></li>
  13. <li><a href="wastewater">Wastewater</a></li>
  14. <li><a href="surveying">Surveying</a></li>
  15. <li><a href="aerial">Aerial</a></li>
  16. <li><a href="it">Technology Consulting</a></li>
  17. </ul>

Regards
chavansoft
Reputation Points: 10
Solved Threads: 0
Newbie Poster
chavansoft is offline Offline
15 posts
since Aug 2009
Sep 2nd, 2009
0

Re: Unordered Lists

You can also do a reset and have all ul not be underlined and only create a class for a list you want to underline.


HTML and CSS Syntax (Toggle Plain Text)
  1.  
  2. <style>
  3.  
  4. ul li {
  5. text-decoration : none;
  6. }
  7.  
  8. </style>
Last edited by AdrianaTX; Sep 2nd, 2009 at 3:30 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AdrianaTX is offline Offline
9 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Good web page designer for Linux
Next Thread in HTML and CSS Forum Timeline: image slideshow..





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC