Home > Software design >  Import another link of a webpage in my html tag to show a button
Import another link of a webpage in my html tag to show a button

Time:10-01

How to import the link of other sites in my HTML tag for using a button. I have import the tag as

and I write the style in css But the imported button which is not shown on the webpage

CodePudding user response:

<a href="http://www.stackoverflow.com/">
    <button>Click Here</button>
</a>

For more How to create an HTML button that acts like a link

CodePudding user response:

It is not normal in HTML to put a button tag inside a link one because it does not give added value, and it is not semantically correct. Links and buttons have different purposes.

You should consider only use a link, and just put some CSS on it to look like a button.

Here is a really simple example just to show you :

div {
  padding-top: 2em;
}
.btn {
  padding-top: 0.5em;
  padding-right: 1em;
  padding-bottom: 0.5em;
  padding-left: 1em;
  border: 1px solid #aaa;
  border-radius: 0.25em;
  text-decoration: none;
}
.btn:hover {
  color: #fff;
  background-color: #aaa;
}
<div>
  <a href="" class="btn">LINK TEST</a>
</div>

If you use Bootstrap framework (or equivalent), it's going to be even more simple with pre-built button classes, see Bootstrap docs.

Thomas.

  • Related