這是一個在元素前面或後面插入內容的方法(搭配 selector:before和selector:after)
HTML:
1 | < a class = "yahoo" href = "http://www.yahoo.com.tw" >Yahoo</ a > |
2 | < a class = "google" href = "http://www.google.com" >Google</ a > |
CSS:
1 | .google:after { |
2 | /* 前後加入~~字串 與網址串接*/ |
3 | content : "~~" attr (href) "~~" |
4 | } |
這樣在畫面就會顯示成
Google~~http://www.google.com~~