If you want to create an HTML button that behaves like an HTML hyperlink (anchor tag a href) then you need to make use of CSS code to make the button look like a hyperlink, lets seem some examples,
Plain HTML button: Code for the plain button:<button type="submit" title="This is a button">myButton</button>
As you see this is just a default looking HTML button, the rendering of this button would vary based on the operating system and the browser you are using, now lets add some CSS code make this button look like a hyperlink.
Plain HTML button as link:Code for plain HTML button as link:
<button class="linkCss" title="This is a button that looks like an hyperlink" type="submit">Button as a link</button>
<style>
.linkCss {
background: none;
border: none;
color: #0064bd;
cursor: pointer;
text-decoration: underline;
}
</style>
How did we made the button look like a link using CSS properties:
- Set background as none
- Set border as none
- Choose a color, mostly blue that looks like a hyperlink say #0064bd
- Now when you hover over the text we should be able to see the pointer so user cursor: pointer
- Now we want a underscore, use text-decoration: underline
More Posts related to Html,
- How to remove old 404 pages ulrs from Google crawler
- W3 HTML validator warning Unable to Determine Parse Mode
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- Align html element at the center of page vertically and horizontally
- HTML Images - Attributes and Formats
- 9 Border to DIV Element in HTML Examples
- Create HTML button that looks like a href hyperlink
- What is the doctype for HTML5?
- Simple Crossword Puzzle example using Pure HTML, CSS and JavaScript
- How to make a div tag clickable
- The author stylesheet specified in tag script is too long - document contains 21759 bytes whereas the limit is 10000 bytes
- W3 : character data is not allowed here html validation error
- How to set background color in HTML page?
- Auto Refresh Webpage after every x Second or Minute using Meta Tag?
- Default speed of Marquee tag : SCROLLAMOUNT
- Get HTML table td, tr or th inner content value with id or name attribute
- How to add multiple spaces between html page text
- Chessboard with pieces using pure HTML and CSS
- How to turn off autocomplete in input fields in HTML Form
- remove div vertical scroll
- Fibonacci series from 1 to 500 table
- Remove Html head and body tags from ckeditor source
- reCaptcha Verification expired. Check the checkbox again
- HTML5 CSS3 Color Codes List
- All directional arrows codes for HTML
More Posts:
- [Fix] zsh: command not found: awscli [Mac Terminal] - AWS
- Download Google Chrome setup exe file using PowerShell - Powershell
- New-SPLogFile PowerShell - create new SharePoint log file - SharePoint
- Two Ways to Extract rar (*.rar) files on Mac - MacOS
- Check version of pip package installer for Python - Python
- SharePoint - Use Today's Date Time in list view filter and calculated column - SharePoint
- Notepad++ Save Failed - Please check if this file is opened in another program. - NotepadPlusPlus
- How to fix Microsoft Windows 10 update error 80070020 - Microsoft