CSS - nested anchor tag link

前端 未结 2 746
我在风中等你
我在风中等你 2021-01-29 02:30

I would like to create nested link inside a tag

Example:

This is a link sup text         


        
2条回答
  •  感动是毒
    2021-01-29 03:25

    Use a SPAN, since you cannot nest anchor tags.

    This is a link sup text end of the link
    

    Ok I'll use span, but how to make the span having the same propreties than anchor tag when anchor tag is hover ?

    Add the hover state to your CSS for the "sup" element.

    a, a:hover #sup {
        font-family: Arial;
        color: #19578e;
        font-size: 10pt;
        font-weight: normal;
        font-style: normal;
        text-decoration: none;
    }
    

    If you have this in more than on place, you can simply use:

    a, a:hover span { ... }
    

提交回复
热议问题