How to add hyperlink functionality using html and css
P粉596191963
P粉596191963 2024-04-01 23:34:12
0
2
482

I have some HTML code that contains some css and I want the button to actually serve a purpose like a hyperlink, I press it and it takes me to a certain file or url, I have tried inside the field Using actual hyperlinks but it looks ugly and only the hyperlink can be pressed, I tried adding an HTML default hyperlink button but it cannot be colored.

code show as below:

<html>
<body style="background-color:rgb(48, 45, 45)">
<font color="white">
<font color="#4CAF50">
<head>
<style>
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button1 {background-color: #4CAF50;}
.button2 {background-color: #008CBA;}
</style>
</head>
<body>
<button class="button button1">Green</button>
<button class="button button2">Blue</button>
</body>

P粉596191963
P粉596191963

reply all(2)
P粉949267121

To link specifically to a file, you can also use the tag mentioned above, but with a relative URL instead of an absolute URL (also known as not including "https://www.").

For example, if you place files in an internal directory outside of the base directory, you can use the following snippet:

File

More information about this here.

P粉035600555

Using the onclick element:

     
    sssccc
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template