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,
- HTML5 HELLO WORLD Example
- All directional arrows codes for HTML
- Adding Sub Headings to Bootstrap Header tags
- Create HTML button that looks like a href hyperlink
- 70+ HTTP Error Codes CheatSheet
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- How to set background color in HTML page?
- Obsolete marquee element alternatives html5
- Base 64 Index, Character and Binary Table
- Get HTML table td, tr or th inner content value with id or name attribute
- Align html element at the center of page vertically and horizontally
- How to add multiple spaces between html page text
- The author stylesheet specified in tag script is too long - document contains 21759 bytes whereas the limit is 10000 bytes
- How to pretty print HTML using Java Code
- W3 HTML validator warning Unable to Determine Parse Mode
- Hyperlink in html (anchor tag) without a underline
- reCaptcha Verification expired. Check the checkbox again
- Auto Refresh Webpage after every x Second or Minute using Meta Tag?
- Chessboard with pieces using pure HTML and CSS
- Default speed of Marquee tag : SCROLLAMOUNT
- Fibonacci series from 1 to 500 table
- 9 Border to DIV Element in HTML Examples
- How to remove old 404 pages ulrs from Google crawler
- Simple Crossword Puzzle example using Pure HTML, CSS and JavaScript
- How to make a div tag clickable
More Posts:
- apt-get list --installed packages in Ubuntu Linux - Ubuntu
- How to get unique values from a list in Python - Python
- SQL: Check if table exists - HowTos
- What is $$ in Bash Shell Script- Special Variable - Bash
- Open New tab using keyboard shortcut in Mac Terminal - Mac-OS-X
- W3 HTML validator warning Unable to Determine Parse Mode - Html
- Show Hidden Files in Mac Terminal - MacOS
- Disable Fading Edges Scroll Effect Android Views - Android