Is it possible to have several responsive images layered on top of one main responsive image

I'm currently working on a map project that involves multiple map pointers (7).

By using the code below, I have successfully positioned them correctly:

<div style="position:relative; left: 0; top: 0;">
    <img src="images/JCCareas.png" class="img-responsive" style="position:relative; left: 0; top: 0;" alt="Map" />
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 375px; top: 455px;" alt="target Solihull" title="Solihull"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 320px; top: 250px;" alt="target Sheldon"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 490px; top: 520px;" alt="target Knowle"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 290px; top: 365px;" alt="target Olton"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 575px; top: 390px;" alt="target Hampton-In-Arden"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 560px; top: 80px;" alt="target Coleshill"/>
    <img src="images/JCCtarget.png" class="img-responsive" style="position:absolute; left: 460px; top: 215px;" alt="target Marston Green"/>
</div>

The map itself is responsive, but the map markers are not. I've attempted various CSS techniques without much success in making them responsive.

These are the CSS methods I've tried:

#under-image {
    position: relative;
    display: inline;
}
#over-image {
    position:absolute;
    left:33%;
    top:43%;
    max-width: 10%;
}

Any assistance or guidance on this issue would be greatly appreciated.

Answer №1

Give this method a shot: use top and left for positioning in percentages.

.img1{left: 28%;
    position: absolute;
    top: 49%;
}
.img2{left: 32%;
    position: absolute;
    top: 87%;
}

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

Struggling to implement a vertical scroll bar within a nested div element

Struggling to make a scroll bar appear in the box-content div, even after adding 'overflow-y:auto'. My specific requirements are: The entire layout should adjust according to the browser height. This is why I've set #wrap { ... height: 50 ...

css code creates a stable block with a blurred transparent effect

I need assistance with creating a transparent fixed header using only CSS and no JS. I attempted to use ::before for creating a blur effect with a negative z-index, but so far, my attempts have failed. I know how to achieve this using jQuery, but I am spec ...

Use jQuery to place tags around the content of existing <li> elements

Using jquery, I have been able to successfully create a list by using the following code: $(list).append(item); (where list is the list reference and item consists of the $('<li>') elements being added). var item = $('<li>' ...

Adjusting Opentok React video to utilize the complete height of the encompassing container

I'm currently utilizing https://www.npmjs.com/package/opentok-react within my application and setting up a publisher and subscriber in a specific div. This is the CSS I have implemented: #videos { position: fixed; right: 0; bottom: 0; ...

Troubleshooting CSS transition issues on ASP.NET Web Forms

Is there a way to make CSS3 transitions work in a .aspx page? I prefer Web Forms for designing forms and any suggestions would be helpful. The following is the code snippet from the .aspx page: <%@ Page Title="" Language="C#" MasterPageFile="~/Sit ...

"Is there a way to assign a default value to a select element while also using ng-model and ng-change in AngularJS

My reason for this question is that I have encountered a situation where ng-model is overriding the default value in the select tag. Therefore, I am looking to establish <option value="-translation.published_at" selected>{{ 'Newest first' | ...

Ways to display data from specific columns using their names in a pair of dropdown lists

I am faced with the challenge of creating a drop-down menu containing column names from a database table. In addition, I need to implement another drop-down menu. My goal is to have the values of the selected column name from the database table displayed ...

What is the best way to create a fixed sidebar or top bar that remains visible as I move to different pages?

Whenever I navigate to other pages, the sidebar mysteriously disappears. As I work on my project about an admin page, I'm wondering if it's necessary to include every single page? ...

How to change the image source using jQuery when hovering over a div and set its class to active?

I am working with a div structure that looks like this: <div class="row margin-bottom-20"> <div class="col-md-3 service-box-v1" id="div1"> <div><a href="#"><img src="path" id="img1" /></a></div> ...

Reacting like sticky bottoms and tops

I'm working on a react/tailwind project that involves a component I want to be fixed at both the top and bottom of the screen. In simpler terms, there's an element that I need to always stay visible even when the user scrolls up or down the page ...

Tips for closing the navbar by clicking elsewhere on the page

Is there a way to modify my code in order for the navbar to close when clicking outside of it, while staying open if something inside it is clicked? $(document).ready(function() { $('.nav-btn').on('click', function() { $('.na ...

Retrieve the value of a tag attribute while the tab is in the active state

Is there a way to extract the value from a specific tag when it is set as active? The tag in question looks like this: <li class="top-tab" role="tab" tabindex="0" aria-selected="true" aria-expanded="true"> TITLE OF SECTION </li> I am interes ...

When a jquery confirm dialog is displayed, the scroll bar mysteriously fades away

Whenever a jQuery confirm dialog is displayed, the scroll bar on the page disappears, causing the page to suddenly shift to the right. Here is the JavaScript code for the dialogue: <script src="vendor/jquery-confirm.min.js"></script> <link ...

The menu is not appearing in a horizontal layout

I'm encountering an issue while working on the Foundation Top Bar tutorial. When I view the code in Firefox and Chrome, the top bar displays vertically instead of horizontally. I've attempted changing the display setting to inline and inline bloc ...

Insert fresh div elements chronologically using jQuery

When a user clicks on the ".u-post-button" button, this script is triggered. It retrieves the content of the comment input field and posts it to the server as a JSON object. The returned data containing the comment information is then appended after the ...

Error loading CSS file: 'Invalid MIME type detected, expecting text/css'

Can someone please help me figure out why none of the CSS files I linked are loading on my website? It's strange because the CSS for another page on the same site is loading without any issues. My server is built using express and I'm using ejs ...

How can I prevent further input in an input field after making a selection from mat autocomplete in angular?

Hello everyone, I am looking to disable the input field after selecting a value from the drop-down. Additionally, I want to be able to reset the selected value using a reset button. If you need a reference, you can check out Stackblitz: https://stackblitz ...

Although Angular allows for CSS to be added in DevTools, it seems to be ineffective when included directly in

Looking to set a maximum length for ellipsis on multiline text using CSS, I tried the following: .body { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } However, this approach did not work. Interesti ...

When converting the .html file to a .php file, the CSS file fails to be linked correctly

The issue I'm facing seems to be specific to the index.html file. The CSS that functions properly with an html extension suddenly stops working when the extension is changed to php. Upon inspecting the reference link in both cases, I noticed that when ...

Setting up Angular Toolkit via npm installation

After successfully installing the UIKit npm package within an Angular 2 CLI project, what steps should I take to utilize it? I have also installed typings for UIKit (@types/uikit), but I am unsure of how to properly import the package into a controller i ...