Hyperlinks within an SVG do not function properly when the SVG is embedded in an image tag within a Bootstrap 5 Modal

Interestingly, the cursor remains unchanged even when hovered over the section with the hyperlink. Strangely, when I view the svg file separately in my browser, the links function properly. Here is the code snippet:
<HTML>


<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-xl">
    <div class="modal-content">
      <div class="modal-body">
        <img src="drawing.svg">
      </div>
      </div>
  </div>
</div>

CSS



.modal-dialog{
  pointer-events: all !important;
}

Despite applying pointer-events :all !important; as shown above, the issue persists.

Answer №1

For those attempting to utilize SVG to reference links within the SVG itself, it is advised to avoid using the <img> tag and instead opt for the <object> tag.

Here's an example:

 <object type="image/svg+xml" data="path/to/your/drawing.svg"></object>


We appreciate your cooperation!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Efficiently Aligning Elements in CSS both Vertically and Horizontally

I'm struggling to align my form both vertically and horizontally. It's okay if this doesn't work on IE - I will include an IE detection script to prompt users to switch browsers. However, Firefox and Chrome support is essential. Below is m ...

What's the best way to expand the right side of .li following a left offset of -20px

My nested list structure looks like this... https://i.sstatic.net/sggVx.png What you see is a recursive ul/li setup... <div class="family d-block"> <span class="pb-2"> <small class="text-muted">Family:</small><br> < ...

Align the last line of flex cells to the left side

I have created a flex structure that resembles a table and adjusts the number of cells based on the content. However, when the last row is not full, the remaining cells stretch to fill the empty space, which affects the overall appearance of the structure. ...

Why doesn't the link to CSS work when placed outside the HTML folder with Gulp-webserver?

When utilizing a html file that links to a css file in the same folder or a subfolder, the css is successfully included when running gulp webserver. However, if the css file is located outside of the html-folder, it fails to be included. For instance, if ...

Guide to setting up a nested vuetify navigation drawer

I am facing a scenario where I have one fixed navigation drawer with icons and another dynamic navigation drawer that should open and close adjacent to the fixed one without overlapping. The current implementation is causing the dynamic drawer to overlap t ...

Is there a way to automatically scroll to the bottom of a div when it first

Looking to enhance my application with a chat feature that automatically scrolls to the bottom of the chat page to display the latest messages. Utilizing VueJs: <template> <div id="app"> <div class="comments" ...

Dynamic jQuery backstretch feature: automatic image cycling and reversing

I am currently using backstretch on my website and attempting to create a continuous loop of the moving image by automatically shifting it from left to right and back. However, I am facing difficulties as the background only moves in one direction. I am se ...

Body overflow appears horizontal in Windows Operating System while it works fine in macOS

After implementing the code below from a helpful CSS Tricks article, my element spanned across the full width of the page, stretching beyond its parent's boundaries: width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin- ...

Using makeStyles() in MUI for conditional rendering

Trying to dynamically change the value of backgroundColor under the property "& + $track" using props.disabled but it seems that MUI does not recognize it. Why could that be? const useStyles = makeStyles((theme) => ({ root: { overflow: "vis ...

Adjusting Screen Size for Lottie Animation in React.js

I need assistance with resizing a lottie animation component on my website's landing page to set its display to none on mobile devices. How can I achieve this? See the lottie component code below: import React from "react"; import Lottie fr ...

Issues with screen scrolling becoming stuck in React and Material UI

Currently facing an unusual issue where scrolling on my mobile website becomes sticky, with intermittent responsiveness to touch. Struggling to identify the root cause as there are no console errors detected. Provided below is a snippet of code for a subse ...

Tips for adjusting the position of overflowing text on a website using CSS in real-time

I'm currently working on an Angular application and I'd like to customize the styling so that any text exceeding 128 characters is not displayed. Ideally, if the text exceeds 128 characters, it should move to the left; otherwise, it should remain ...

Strange occurrences observed with the interaction of multiple CSS classes

Recently, I encountered a situation with a class that had me puzzled. .lifetime .containerrow { text-align: center; height: 20px; } To enhance the appearance of certain elements by making their text bold, I attempted the following: .lifetime .co ...

The functionality of Image Map is operational in Chrome and FireFox, but encountering issues in Internet Explorer

Hey everyone, I've been struggling with this issue for weeks now. My image map works perfectly in Firefox and Chrome, but for some reason, it's not functioning in Internet Explorer. Could someone please take a look at my code and help me figure o ...

Struggling with Bootstrap 5: Issue with full width footer display

Struggling with making the Bootstrap footer in full width? I've been using the Bootstrap footer example but can't seem to figure out how to achieve a full-width footer. https://i.sstatic.net/uGOdz.png <link rel="stylesheet" href="https://c ...

Is it possible to vertically resize just one of three divs to match the size of the window?

I'm facing a challenge in creating a responsive webpage with multiple divs. Here is the structure I am trying to achieve: <div id="container"> maximum width of 1200 and height of 1000 <div id="vertically-static-top">20 pixels high< ...

Using jQuery to locate a JavaScript variable is a common practice in web development

I recently created a JSFiddle with buttons. As part of my journey to learn jQuery, I have been converting old JavaScript fiddles into jQuery implementations. However, I seem to be facing a challenge when it comes to converting the way JavaScript fetches an ...

Continuously I am being informed that the value is null

Check out this code snippet: var Ribbon = /** @class */ (function () { function Ribbon(svg) { // Code here... } Ribbon.prototype.init = function() { // Initialization code here... }; Ribbon.prototype.updateR ...

The Bootstrap carousel comes with a brilliant feature! Conceal those 'previous' and 'next' buttons when you reach the first and last slide. However, it seems like the 'slide' event is not functioning as

I have implemented a standard Bootstrap carousel on my website: <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#myCarousel" data- ...

Tips for organizing three flexbox divs in a horizontal row

Within the content div, I have three separate divs that resize when the browser window is adjusted. The blue and red divs should maintain a fixed width The green div should resize to fill any available space on the left I attempted to accomplish this usi ...