I am currently engaged in a Portfolio project, where my objective is to ensure that all images are optimized for responsiveness

While Bootstrap ensures that relative images are responsive, absolute images may not be. This can cause alignment issues when the browser window is resized on mobile devices.

.title-img {
  position: relative;
  width: 100%;
  height: 100%;
}
.skill-back {
  position: absolute;
  bottom: 25%;
  top: 10%;
  right: 6%;
  width: 50%;
  height: 100%;
  opacity: 0.5;
  z-index: -1;
}
.html {
  position: absolute;
  z-index: 4;
  width: 15%;
  height: auto;
  top: 450px;
  left: 75%;
}
.css {
  position: absolute;
  width: 10%;
  top: 70%;
  left: 52%;
  z-index: 3;
  height: auto;
}
.js {
  position: absolute;
  width: 8%;
  left: 79%;
  top: 38%;
  z-index: 1;
  height: auto;
}
<div class="profile col-lg-6">
            <img class="skill-back" src="images/skill-back.svg" alt="black-circle">
            <img class="html" src="images/html-skill.svg" alt="html-skill">
            <img class="js"src="images/js-skill.svg" alt="">
            <img class="css"src="images/css-skill.svg" alt="">
            <img class="title-img" src="images/developerboy.svg" alt="developerboy">
          </div>

Answer №1

To ensure that your images are displayed correctly on all devices, you can utilize CSS media queries. Below is the code snippet to make your images responsive:

/* For desktops/laptops */
    @media (max-width: 1400px) {
      img {
        width: 100%;
      }
    }  
/* For tablets */
    @media (max-width: 800px) {
      img {
        width: 80%;
      }
    }   
/* For mobile phones */
    @media (max-width: 400px) {
      img {
        width: 80%;
      }
    }   

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

Ways to access the files attribute in an input tag in AngularJS without relying on getElementById

I am currently working on file uploads using AngularJS and I have a question regarding how to retrieve input files similar to regular JS. What I want to achieve: HTML: <input type="file" name="file" id="fileImg" accept="image/*"> JS: var file ...

What is the best way to stack div elements one after the other?

I am a complete beginner in HTML and I have a project for my web design class about a movie. http://jsfiddle.net/Lbo1ftu9/ <div id="footer"> <a href="D:/MOVIE REPORT/akira.htm" title="GO BACK?"><img src="D:/IMAGES/goback.gif"> My code ...

Style the nth child of a particular type in CSS with a unique color scheme

Is there a way to select the nth child of type and apply different colors without assigning IDs because they are dynamically generated in a loop from a template engine? I found some useful information on this topic here: https://www.w3schools.com/cssref/ ...

Can jQuery be used to change the functionality of a submit button, such as toggling between show, hide, and submit options?

I am having trouble toggling a button to either submit a form on click or reveal an input field, depending on whether the user clicks outside the input field to hide/collapse it. The issue arises when the user dismisses the input field and the submit butto ...

Incorporating a new text tag

Is there a way to add a text label for every circle that can be rotated and have its color changed? I'm looking for a solution that doesn't involve JSON data, but instead retrieves the necessary information from somewhere else. var w = 3 ...

EJS: Warning when the "<%= %>" tag is used multiple times within the code

I am currently working on incorporating EJS with Node.js and Express.js. I have defined an array variable called "kindOfDay" containing the names of days as strings, such as "Sun", "Mon"... Within the EJS views folder, there is a file named list.ejs. The i ...

Uploading CSV files in Angular 4

I am currently working on an Angular4 project where I have implemented a feature that converts data into a CSV file with a header. Now, I am looking to reverse this process and allow users to upload a CSV file instead. To test this functionality, I create ...

Images of varying sizes aligned at the bottom of cards, organized in rows with pure CSS styling

I am working on a layout that involves a container with "cards": images positioned above with related text below. Here's an example: <div class = "cards"> <div class = "card"> <div class = "image-wrap"> <img src= "im ...

Is it possible to break a single word when word wrapping?

Is it possible to apply word-wrap: break-word to just one word within an element without affecting the entire element? I find that when I apply it to the entire element, it looks messy. I tried searching for a solution but couldn't find anything. Has ...

What is the best way to ensure proper alignment of elements in a React application?

Currently, I am delving into learning react and antd by putting it into practice. My goal is to create a layout with a button and two input fields that have a 10px gap between them, while also displaying the titles of each field directly above them. To ach ...

Tips for incorporating a custom CSS design into a jQueryUI tooltip

I am struggling to apply my custom CSS class on top of the jQueryUI tooltip. Although the tooltip is displaying correctly, my styles are not being applied. Here is the code I'm using: $(document).ready(function () { $("#roles").tooltip({ content: ...

What is the best way to insert an HTML data attribute string into a SCSS mixin using attr()?

I'm currently working on setting up a color scheme in SCSS that allows me to use the following HTML structure: <div class="swatch" data-bg="green">...</div> In my SCSS file, I have defined a mixin like this: @function color($key: ' ...

Is there a way to maintain the selected position on the drop-down menu for users?

Whenever I choose an option from the drop-down field in my form, it automatically jumps back to the top of the page. Just to clarify, I have a drop-down menu at the top of the page and several input fields below. Users need to scroll down to reach the dro ...

What could be causing the message "Please right click to enable Adobe Flash Player" to appear on my site?

Recently, every time I try to reload my webpage, a strange message from Adobe Flash Player pops up and quickly disappears, even though I don't have any flash animations on my site. It's puzzling me as to why this is happening. If you'd like ...

Automating button clicks after a component has loaded in Angular 2+ can be achieved by implementing a

Currently, I am working on implementing an automatic search function in Angular that triggers after a component loads. Right now, the function is triggered by a button click, but I want to automate this process. <button mat-raised-button class="mat-whi ...

Merge JSON object information into tables, including column headings

I am currently facing a challenge in loading multiple JSON files into tables within different divs. Here is the structure of my JSON data: JSON file 1: [ { "id": 12345, "code": "final", "error": "", "data": [ ...

Adjust the height of a div in JQuery to fit new content after specifying a height previously

I have a division element with an initial height of 0 and opacity set to zero, its overflow is hidden, and it contains some content. <div style='height: 0px; opacity: 0px; display: none; overflow: hidden; border: 1px solid #000;' id='myd ...

Upload button allowing multiple values to be uploaded as a single file

I'm currently facing an issue with my list of values and upload buttons. The file upload functionality is working correctly, but the problem arises when I try to upload a file for any item in the list - it always uploads for the first item only. Here ...

Click automatically upon loading the page

I'm looking for help to automatically click a button after the page loads. I currently have to manually click the "Buy the basket" button, but I am not familiar with coding at all. I need a fully ready code that can automate this process for me. Can s ...

Is there a way to locate multiple buttons on a webpage that have the same id and field name but varying values using selenium?

On my webpage, I am looking to interact with four submit buttons. All four buttons have identical Id and name attributes, with the only difference being their values. Is it possible to locate and handle these elements using Selenium WebDriver? (Consideri ...