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,
- 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:
- How to know the current shell you are logged in? - Bash
- List of New Features in Java 11 (JEPs) - Java
- Rust: Cargo Init vs Cargo New Command - Rust
- Fix: Curl No Match Found Error - cURL
- Android Studio Change SDK Path - Android
- AWS CLI Command to Get a List of SNS Topics - AWS
- Add Bookmark macOS Safari - MacOS
- Upgrade Gradle in Android Studio - Gradle