How to Add a Dotted Underline Beneath HTML Text

后端 未结 9 1536
挽巷
挽巷 2020-12-23 19:54

How do you underline html text so that the line beneath the text is dotted rather than the standard underline? Preferably, I would like to do this without using a separate C

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 20:53

    Without CSS, you basically are stuck with using an image tag. Basically make an image of the text and add the underline. That basically means your page is useless to a screen reader.

    With CSS, it is simple.

    HTML:

    I like cheese
    

    CSS:

    u.dotted{
      border-bottom: 1px dashed #999;
      text-decoration: none; 
    }
    

    Running Example

    Example page

    
    
    
        
    
    
        I like cheese
    
    
    

提交回复
热议问题