Looking for assistance with resizing SVG images

I am facing some challenges with the HTML/CSS code to make all SVG's scale uniformly in terms of height/width. I have set up a simple structure but I'm unsure of what steps to take next.

When I view the images in the browser, they are all scaled to full screen and appear the same size based on their dimensions. However, when integrated into HTML, the results are not quite satisfactory.

Any suggestions or tips would be greatly appreciated.

img {
 height: auto;
 width: 75%;
  
}

.card {
  display: flex;
  justify-content: center;
  align-items: center;
} 
<!doctype html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <!-- Bootstrap CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

  <!-- CUSTOM CSS -->
  <link rel="stylesheet" href="main.css">

  <title>Debugging</title>
</head>

<body>

  <!-- COURSES -->
  <div class="container courses-container">
    <div class="row ">
      <!--COURSE 1-->
      <div class="col-6 col-md-4 col-xl-2 course-item">
        <div class="card text-center">
          <img src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/aa.svg">
          <div class="card-body">
            <h5 class="card-title">Monster One</h5>
            <p class="card-text">The fish text website will help the designer, developer, webmaster generate a few paragraphs of somewhat meaningful fish text in Russian, and help the beginner orator sharpen their public speaking skills at home.</p>
            <a href="#" class="btn btn-primary">Learn More</a>
          </div>
        </div>
      </div>
      <!--COURSE 2-->
      <div class="col-6 col-md-4    col-xl-2 course-item">
        <div class="card text-center">
          <img src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/USStates.svg">
          <div class="card-body">
            <h5 class="card-title">Monster Two</h5>
            <p class="card-text">The fish text website will help the designer, developer, webmaster generate a few paragraphs of somewhat meaningful fish text in Russian, and help the beginner orator sharpen their public speaking skills at home.</p>
            <a href="#" class="btn btn-primary">Learn More</a>
          </div>
        </div>
      </div>
      <!--COURSE 3-->
      <div class="col-6 col-md-4    col-xl-2 course-item">
        <div class="card text-center">
          <img src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/Steps.svg">
          <div class="card-body">
            <h5 class="card-title">Guitar</h5>
            <p class="card-text">The fish text website will help the designer, developer, webmaster generate a few paragraphs of somewhat meaningful fish text in Russian, and help the beginner orator sharpen their public speaking skills at home.</p>
            <a href="#" class="btn btn-primary">Learn More</a>
          </div>
        </div>
</body>


</html>

Answer â„–1

Notice the difference in size, check their viewbox,
simply update your css to

img {
  height: 183px;
  width : auto;
}

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

Top 10 SQL Query based on two specific columns

As a beginner programmer diving into the world of SQL, I am on a mission to create a table for my website that showcases the lowest 10 grades alongside student information. While I feel confident in most aspects of this task, I am struggling with crafting ...

Tips on avoiding a page reload following a form submission using JQuery

Currently developing a website for my app development project, I've encountered an unusual issue. Utilizing some JQuery to transfer form data to a php page called 'process.php' and then add it to my database. The strange part is that the pa ...

What strategies can I use to ensure consistent website layout across various zoom levels and browsers?

As a newcomer to web design, I am excited that my site is almost ready to go live. However, I have encountered some significant issues right before launch. When the site is zoomed in or out, the content becomes misaligned at certain zoom percentages. Add ...

Activate the Twitter Bootstrap Lightbox when the page is loaded

Is there a way to make my twitter bootstrap lightbox automatically trigger when the HTML page loads? Currently, I have this script in my 'main.js' file: function lightbox(){ $('#myLightbox').lightbox(); }; I heard that I can us ...

Utilize a fresh function in Angular to retrieve and store data from a URL into a variable

Currently, I am attempting to utilize Angular in order to retrieve data from a link upon clicking a button. As a newcomer to Angular with only 2 days experience, my knowledge is quite limited. What I aim to achieve is triggering the loading of JSON data w ...

Using JQuery to locate and substitute occurrences of HTML elements throughout my webpage

Looking for assistance with a JQuery search and replace task involving multiple instances of HTML within a specific DIV element on my webpage. Specifically, I need to change certain items in the textbox to a simpler display format. Here is a snippet of th ...

Tips for creating inline links

Data is taken from a table using $number and printed as follows: echo "<div class='pagination'><a href='page_pagination.php?number=". $number ."' > ". $number ." </a></div>"; The output does not display in one ...

Using WebDriver to select and interact with a hyperlink on a website

I am currently attempting to select a specific link on a webpage, which happens to be a Home button consistently located in the same position no matter where I navigate. I have been using the driver.findElement(By.xpath("//span/ul/li/a")).click(); command ...

How should white space be managed in Bootstrap 4 cards when incorporating responsive column classes - wrap elements inside divs or apply classes directly?

In Bootstrap 4, when applying a responsive column class like "col-sm-8" directly to a "div" with the class "card", whitespace is added between the card border and content. This can be seen in the highlighted yellow area in the image below. https://i.sstat ...

Getting 100% height on floated neighboring divs: Tips and tricks

​<div id='container'> <div class='left'></div> <div class='right'></div> <div class='clear'></div> </div>​​​​​​​​​​​​​​​​â ...

hyperlink to choose a specific option from a drop-down menu

The challenge I am currently working on involves page1.html <a href="/foo"></a> foo.html <select ng-model="ctrl.listvalues"> <option id="{{item.value}}" ng-repeat="item" in ctrl.availableValues" value="{{item.value}}">item.di ...

Modify the appearance of a Javascript file that is parsing data from a text file

I am working on an HTML project where I have a JavaScript file that reads from a text file. Currently, the text from the file is displaying in my HTML file, but I would like to style it using CSS. Can anyone provide guidance on how to achieve this? I am st ...

posting data and redirecting fails when using an ajax button

I am encountering an issue where I click a button on a page to navigate to another page with posted data, but it is redirecting without posting anything. Both $_POST and $_SESSION variables are empty. Below is my ajax function: function ajax4(Div_Submit, ...

Looking to display several charts on a single page with varying datasets?

I have successfully integrated a doughnut chart plugin into my website. However, I would like to display multiple charts on the same page with different data sets. Below is the code snippet for the current chart being used: This is the chart I am using & ...

Are `<text>` nodes unable to utilize ligature fonts in CSS/SVG?

Check out this JsFiddle demo: http://jsfiddle.net/d0t3yggb/ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <div class="material-icons">add add add add</div> <svg width="100%" height="100% ...

Data loaded by the load() function disappears following an ajax action

I need assistance with a sorting page I am creating that displays content from a database and allows users to sort it using listjs. The issue I am facing is that when I click on any button, the loaded content disappears. Strangely, manually adding content ...

Conceal the column title for order items in the WooCommerce admin panel

I've been attempting to hide certain columns within the administrative section of Woocommerce, but have had no success with the code I'm using. I'm currently stuck and my question is: Is there a way for me to conceal specific column names i ...

Iterating over an array and displaying elements on the webpage

Struggling to access an array and loop through it, but only able to print out one element instead of all. Need a hint on how to solve this issue. See my code below: let toppingsCount; const burger = document.createElement('div'); const toppingsD ...

What is the best way to extract information from a dynamically generated input field using vanilla JavaScript?

Creating a dynamic input field inside the 'education-field' div is the main goal here. The user can add more fields by clicking the "Add more" button, and the data from these input fields is crucial for form validation purposes. Users can input t ...

Maintaining the current tabIndex while navigating between NextJS pages involves setting the tabIndex state in each

What is the best way to store and retrieve the current tabIndex when moving from one page to another? (One idea is to create a function that saves the current index in the sessionStorage and then retrieves it when the page loads) For example: https://i. ...