html - 我试图让我的按钮可点击,所以我有一个使用 h ref 和 button 元素的网站链接
问题描述
我希望我的按钮链接到我创建的实际网站:例如 Joeys Auto
我的投资组合网站是:http : //loriroberg.com/cssfinalproject/index.html#home 它有一个 JOEYS AUTO 按钮。Joeys Auto 的网站是http://loriroberg.com/final/index.html
如何更改此代码:
<div class="w3-col m3"><button class="button4 w3-button w3-padding-large w3-light-grey" style="margin-top:64px">Joeys Auto</button></div>
所以它会链接到JOEYS AUTO?
以下代码位于我的投资组合的 MY PROJECTS 部分下。
<h3 class="w3-center">MY PROJECTS</h3>
<p class="w3-center"><em>Here are some of the projects I completed.<br />
I will post more soon.<br />
Click on the links to view them on the web.</em></p>
<br />
<!-- Responsive Grid. Four columns on tablets, laptops and desktops. Will stack on mobile devices/small screens (100% width) -->
<div class="w3-row-padding w3-center">
<div class="w3-col m3"><button class="button4 w3-button w3-padding-large w3-light-grey" style="margin-top:64px">Joeys Auto</button></div>
<div class="w3-col m3"><button class="button4 w3-button w3-padding-large w3-light-grey" style="margin-top:64px">CSS3 2D Animation</button></div>
<div class="w3-col m3"><button class="button4 w3-button w3-padding-large w3-light-grey" style="margin-top:64px">CSS3 Animation</button></div>
<div class="w3-col m3"><button class="button4 w3-button w3-padding-large w3-light-grey" style="margin-top:64px">CSS3 3D Animation</button></div>
<!--<button class="w3-button w3-padding-large w3-light-grey" style="margin-top:64px">LOAD MORE</button>
解决方案
对于链接到其他网站(例如从您的投资组合链接到外部网站),您需要使用HTML 锚标记。您可以使用以下链接:
<a href="http://example.com">Joey's Auto</a>
如果您已经在 loriroberg.com,您还可以使用相对 URL:
<a href="/final/index.html">Joey's Auto</a>
这将带你到http://loriroberg.com/final/index.html
. 您可以在此 StackOverflow 问题中找到有关相对 URL 与绝对 URL 的更多信息
推荐阅读
- ruby-on-rails - Rails 5.2 - 尝试定义枚举时出现 ArgumentError
- jasmine - 如何用 jasmine-karma 覆盖函数的所有行
- linux - linux usb小工具流量监控
- sql - 在 MS ACCESS 替换表中搜索所有相关号码的最简单方法是什么?描述中更好的解释
- typescript - 如何在非静态方法中获取静态属性 - 打字稿
- go - 为什么我的“完成”频道随机关闭?
- windows - Windows 证书交互式登录
- android - 有没有办法在 react-native 应用程序上显示 CPU 和内存使用情况?
- laravel - 将经过身份验证的用户添加到相关模型的最佳方法是什么?
- java - 为什么 getWidth 函数在 JAVA 中返回更多的值?