Tengo un mapa y en el mapa tengo la funcionalidad de acercar y alejar, mi pregunta es cómo hacer que la parte roja sea invisible pero no los botones, de modo que cuando el usuario busque una ubicación en el mapa, este div no debería bloquear la vista, solo eso. el botón debe estar visible.
El inglés no es mi lengua materna, por lo que podría haber errores.
import React from "react"; import ReactDOM from "react-dom"; import "./styles.css"; import styled from "styled-components"; const Toolbox = styled.div` display: flex; justify-content: end; width: 100%; max-width: calc(100vw - 60px); margin-bottom: 10px; background-color:red button { margin-left: 10px; width: 2em; height:2em } `; function App() { return ( <Toolbox> <button onClick={''}>+</button> <button onClick={''}>-</button> <button onClick={''}>x</button> </Toolbox> ); } const rootElement = document.getElementById("root"); ReactDOM.render(<App />, rootElement);se ve así en este momento:
Uso: position: absolute;
.Map { position: relative; background: #eee; min-height: 150px; } .Toolbox { position: absolute; right: 0; top: 0; background: red; padding: 10px; } <div class="Map"> Here goes the map <div class="Toolbox"> <button type="button">+</button> <button type="button">-</button> </div> </div>¿Has intentado eliminar el 'fondo: rojo' de tu CSS?