In Html we have the Anchor tags which is a clickable element, so if you have a div tag or any other tag like span or p you can make it clickable simply by wrapping it with an anchor tag. Let's see an example,
Example :
<div style="background-color:#09C;color:#fff;padding:20px;margin:20px">Div tag : Not Clickable</div>
Result :
Div tag : Not Clickable
Now simply wrap the above div with an anchor tag, note if you have some text within your div tag and you don't want it to be underlined as in case of a hyperlink, just add textdecoration:none in the style tag.
Example :
<a href="http://code2care.org" style="text-decoration:none">
<div style="background-color:#09C;color:#fff;padding:20px;margin:20px">This is my div tag : Clickable</div>
Result :
This is my div tag : Clickable
More Posts related to Html,
- remove div vertical scroll
- Create HTML button that looks like a href hyperlink
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- HTML5 HELLO WORLD Example
- Get HTML table td, tr or th inner content value with id or name attribute
- Adding Sub Headings to Bootstrap Header tags
- What is the doctype for HTML5?
- Chessboard with pieces using pure HTML and CSS
- Hyperlink in html (anchor tag) without a underline
- W3 : character data is not allowed here html validation error
- Fibonacci series from 1 to 500 table
- 9 Border to DIV Element in HTML Examples
- How to add multiple spaces between html page text
- How to turn off autocomplete in input fields in HTML Form
- Default speed of Marquee tag : SCROLLAMOUNT
- How to word wrap in HTML
- Force convert HTML text input to upper case
- HTML5 CSS3 Color Codes List
- How to remove old 404 pages ulrs from Google crawler
- reCaptcha Verification expired. Check the checkbox again
- All directional arrows codes for HTML
- Align html element at the center of page vertically and horizontally
- How to make a div tag clickable
- Remove Html head and body tags from ckeditor source
- Auto Refresh Webpage after every x Second or Minute using Meta Tag?
More Posts:
- PHP header location function not called - PHP
- How to stop disable Facebook video autoplay during scroll - Facebook
- How to Set Permanent ruler in Sublime Text - Sublime-Text
- How to install zsh shell on Ubuntu - Ubuntu
- Emulator: Warning: restoring GLES1 context from snapshot. App may need reloading. - Android-Studio
- How to Merge Branch into Master Branch - Git
- Android Studio NoClassDefFoundError: java.awt.Toolkit - Android-Studio
- Enable spell check in Sublime Text (macOS) - MacOS