2012-08-04 60 views
0

iam getting in my view sometime very long urls like this:如何短長的URL在<a href="" .......?

"https://www.google.de/#hl=de&sclient=psy-ab&q=break+long+url+css&oq=break+long+url+&gs_l=serp.1.1.0i30l4.3822.3822.0.5634.1.1.0.0.0.0.85.85.1.1.0...0.0...1c.Hao7HfzLitY&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=48c9a29cac04fd97&biw=1680&bih=925" 

it very anoying because takes a lot of place.

i want to give out in my view just short version of it like ->"https://www.google.de/#hl=de&sclient=psy-"

but i will click it, then landing again on this one which contains full path.

how can i do it with html a href="" link???

+2

您可以將完整的示例鏈接放入您的問題中,然後明確地顯示您希望它成爲什麼?你是想縮短'href'中的內容並創建一個'short URL'(與[tinyurl](http://www.tinyurl.com/)一樣),或者你想要顯示'href' * text *,但只顯示該'href'的縮寫版本? – 2012-08-04 20:39:56

+1

我不確定你在這裏問什麼 - 如何使用錨標籤?標籤和'href'的內容不必匹配,如果這是個問題。 – Oded 2012-08-04 20:40:57

+0

你能解釋一下URL的來源以及它是如何進入頁面的嗎? – Oded 2012-08-04 20:44:25

回答

4
<a href="full-url">short-url</a> 

短網址將被顯示在頁面上,但鏈接將指向完整URL。

+0

haha​​ha,很簡單!!有時候我的頭上充滿了木屑!這是很大的,謝謝。這將是八月最好的笑話!!! haha​​ha – 2012-08-04 20:50:35

+0

不確定這是OP首先要求的,看起來像評論確認它 – Oded 2012-08-04 20:50:52

+0

Oded,是的,我仍然更寬鬆,我的問題可以非常愚蠢;) – 2012-08-04 20:54:04