Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
Svg to be able to be clicked, and not interfere with the YouTube

I'm having an issue with the svg being over the YouTube.

If you put your mouse over, just off to the right side of the svg and click, the video doesn't open, instead, it takes you back to the previous page.

Clicking on the space in-between the svg, that should open the YouTube video, it doesn't, instead, it takes you back to the previous page.

Everything outside the svg should be YouTube.

Only the area within the red line only should be clickable taking the user to Home

pointer-events: none; would need to be in place, or it interferes with the YouTube video.

The issue with using:

svg.home {
 pointer-events: none;
}

While that works with the svg not interfering, it also disables being able to click on the svg.

How would this be fixed?

I need the svg to be able to be clicked, and not interfere with the YouTube.

https://jsfiddle.net/hwm8qtoz/1/

.home {
  position: absolute;
  top: calc(60% - 25px); /*25px is half the height of the svg*/
  left: 0px;
  width: 50px;
  height: 50px;
  fill: green;
  cursor: pointer;
}

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Because CSS has a box modal and everything is a box. So the entire house is inside a box and the entire box would be clickable or the entire box would not be clickable.

It can be solved in two ways

  1. You can divide your Home SVG into multiple svgs. e.g. 3 parts = (Home Roof + Home Left Side + Home Right Side). Arrange these svgs in such a way that it looks like the house and then make the parent of these SVGs clickable that takes you to previous page.
  2. Create your SVG using multiple paths and make each path individually clickable(taking user to previous page). See this for an idea http://thenewcode.com/696/Using-SVG-as-an-Alternative-To-Imagemaps
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda