iT邦幫忙

2024 iThome 鐵人賽

DAY 6
0

當你需要按下此連結,就能跳到另一個指定網頁,那就需要用到<a>
<a>主要是在html裡面建立超連結的元素,在<a>裡面也能搭配文字、圖片等等做使用
接者,我們就來實際做做看吧~

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="https://google.com">google</a>
    <br>
    <a href="https://yahoo.com">yahoo</a>
    <br>
    <a href="https://www.youtube.com">youtube</a>
</body>
</html>

其實只需要在<a>裡面加上href後面再加上指定的連結這樣就可以了,
<a></a>之間可以加入想顯示的文字或圖片也可以,而<br>主要就是換行的功能,
最後顯示的結果就像這樣
https://ithelp.ithome.com.tw/upload/images/20240911/20168468godrSQFBXT.png
按下yahoo就會跳到yahoo的網頁
https://ithelp.ithome.com.tw/upload/images/20240911/20168468zAAwjHFCYM.png

這樣就代表連結成功啦~/images/emoticon/emoticon34.gif


上一篇
Day5.基礎表格<tr><th>
下一篇
Day7.<h1>-<h6>標題元素
系列文
Web前端的探索:30天的驚奇之旅23
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言