CSS After Element to insert mailto link?

后端 未结 5 1468
臣服心动
臣服心动 2020-12-03 22:05

I\'m attempting to display a mailto link. Is that possible with CSS?

html

  • <
    5条回答
    •  离开以前
      2020-12-03 22:42

      This might be useful to someone...

      Instead of inserting the link with the css, I coded it into the html with an href & class, but left it empty. Like this:

      This text is always here.

      .mobile:after { content:'Click here to email us.' }

      That way the link doesn't appear (height:0, width:0) until it has content.

      I used it for a responsive store locator where the map was stacked on top of the location list at small screen sizes, necessitating a link to the list anchor. I considered it a "design" decision, which is the only justifiable reason to do it.

    提交回复
    热议问题