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,
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- HTML5 HELLO WORLD Example
- What is the doctype for HTML5?
- 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
- HTML, HTML5. CSS, CSS3 Color Codes 2020
- Obsolete marquee element alternatives html5
- Create HTML button that looks like a href hyperlink
- All directional arrows codes for HTML
- Adding Sub Headings to Bootstrap Header tags
- Hyperlink in html (anchor tag) without a underline
- Align html element at the center of page vertically and horizontally
- How to remove old 404 pages ulrs from Google crawler
- How to set background color in HTML page?
- Default speed of Marquee tag : SCROLLAMOUNT
- W3 HTML validator warning Unable to Determine Parse Mode
- Get HTML table td, tr or th inner content value with id or name attribute
- reCaptcha Verification expired. Check the checkbox again
- How to word wrap in HTML
- Base 64 Index, Character and Binary Table
- Fibonacci series from 1 to 500 table
- How to make a div tag clickable
- Remove Html head and body tags from ckeditor source
- remove div vertical scroll
- Chessboard with pieces using pure HTML and CSS
More Posts:
- The package must have at least one . separator [Android Studio] - Android-Studio
- Make div element draggable using jQuery - jQuery
- How to make a Android button act as a toggle button - Android
- How to Kill service running on port using terminal command - HowTos
- Export aborted because fatal lint error were found - Android
- How to check if Java main thread is alive - Java
- Remove Applications from Startup Mac OS X - Mac-OS-X
- How to Stop Photos App from auto loading when device connected to the Mac - Mac-OS-X
- Custom Toast Android Programming - Android
- CSS: Apply opacity only for div background and not text - CSS
- Resolving DNS_PROBE_FINISHED_NXDOMAIN Google Chrome Error - Google
- How to make div or text in html unselectable using CSS - CSS
- DDMS files not found hprof-conv.exe - Android
- Android Studio : Change FAB icon color : FloatingActionButton - Android-Studio
- [Hibernate] The method buildSessionFactory() from the type Configuration is deprecated - Java