Liên kết nút html tới tệp cục bộ

Liên kết liên kết được sử dụng để điều hướng đến các trang bên trong trang web hoặc trang web của các trang web khác. Bài viết này nhằm mục đích hướng dẫn bạn các phương pháp khác nhau để tạo một nút liên kết đến một trang khác trong HTML

Ngoài ra, hướng dẫn này phục vụ các kết quả sau

In HTML, the tag and the tag are used  to create a button link. Mostly, the tag is utilized to make a link on a button. Moreover, the href =”” attribute specifies the path to another page.

Tạo một nút liên kết đến một trang khác trong HTML

The button link can be created by using the , , and tag. Each tag refers to a specific attribute to create a link to another page. For instance, the “href” attribute of tag serves the purpose.

Phân đoạn này cung cấp một bản tóm tắt chi tiết về tất cả các phương pháp để tạo các nút liên kết đến một trang khác trong HTML

To create a button link to another page in HTML,just add tag and wrap it around the simple Html button. Inside a tag simply use href=“” attribute to give the path of the desired page.

Thí dụ

< đầu >
< liên kết href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="biểu định kiểu" >
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" >< /tập lệnh >
    <title>Button</title>
    <style>
        .container{
          chiều cao. 200px;
          chiều rộng. 500px;
          đường viền. Màu đen đặc 2px;
            lề trên. 30px;
        }
      < / . center;">
</head>
<body>
    <div class="container">
        <h1 style="text-align:center;" > Nút Html đơn giản < /h1>
        <a href="https://www.google.com/" >
            < nút class="btn btn-primary btn-lg">Click</button>
        </a>
    </div>
</body>

In the above example, we have created a button and the tag creates a link to another page (www.google.com)

đầu ra

Liên kết nút html tới tệp cục bộ

Đầu ra cho thấy rằng, sau khi nhấp vào nút “Nhấp chuột”, bạn sẽ được điều hướng đến “Google” ngay lập tức

We can create a button with a link to another page with the help of the tag. To do so, we need tag  and onclick=”” attribute to specify the link.

The following code makes use of the tag to create a button with a link to another page.

Thí dụ

< đầu >
    < meta name="viewport" content="width=device-width, initial-scale=1.0" >
    < liên kết href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"rel="biểu định kiểu" >
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" >< /tập lệnh >
    <title>Button</title>
    <style>
        .container{
            chiều cao . 200px;
            chiều rộng . 500px;
            đường viền . Màu đen đặc 2px;
            lề trên. 30px;
          }
    < / . center;">
</head>
<body>
    <div class="container">
        <h1 style="text-align:center;" >Html Liên kết Nút có thẻ nhập< /h1>
        <input type="button" onclick="window.location.href='https://www.instagram.com/?hl=en';" lớp="btn btn-cảnh báo btn-lg" value="Click"/>
    </div>
</body>

In the code, the tag is used with “type”, “onclick”, “class”, and “value” attributes. A link is pasted in the “onclick” attribute of HTML.

đầu ra

Liên kết nút html tới tệp cục bộ

Đầu ra cho thấy rằng, sau khi nhấp vào nút “Nhấp chuột”, bạn sẽ được điều hướng đến trang đăng nhập “Instagram” ngay lập tức.  

We can create a button with a link to another page with the help of the tag. To do that we need the tag with action attribute to specify the page path. The following code represents the functionality of tag to make a button link to another page:

Thí dụ

< đầu >
    < meta name="viewport" content="width=device-width, initial-scale=1.0" >
    < liên kết href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="biểu định kiểu" >
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" >< /tập lệnh >
    <title>Button</title>
    <style>
        .container{
            chiều cao . 200px;
            chiều rộng . 500px;
            đường viền . Màu đen đặc 2px;
            lề trên. 30px;
          }
    < / . center;">
</head>
<body>
    <div class="container">
        <h1 style="text-align:center;" >Html Liên kết Nút Có hành động attribute</h1>
        <form action="https://twitter.com/" >
            < nút lớp="btn btn-danger btn-lg">Click</button>
        </form>
    </div>
</body>

In this example we use tag with action attribute to specify the path. A button is created using