The `d-flex flex-column` is causing the image within the div to be hidden

The setup looks like this:

<div className="d-flex flex-column">
  <div>
     Text
  </div>
  <div style={{ backgroundImage: 'url(...)' }}>
  </div>
</div>

The URL is functioning correctly. The div element is present, but the image does not display. When I switch to using flex-row, the image shows up.

Answer №1

Include two additional styling options

background-size: contain;background-repeat: no-repeat;

<div class="d-flex flex-column">
  <div>
     Text
  </div>
  <div style="background: url(https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png);background-size: contain;background-repeat: no-repeat;">
  <br><br><br><br>
  </div>
</div>

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

incorporating HTML attributes without specified values in .NET

Is there a way to include the multiple attribute in a select element using .net? I attempted the following approach: If MultiSelect Then drpSelect.Attributes.Add("multiple", "true") End If However, technically speaking, the HTML should only require the ...

Understanding the Importance and Benefits of Using the Classnames Utility in React Components

Can you break down for me the purpose of utilizing the Classnames utility in React code? I've reviewed the Classnames documentation, but I'm still struggling to comprehend why it is used in code like this: import classnames from 'classnames ...

Mui Drawer transitions

I'm currently working on a project for a company and using Mui drawer with a variant drawer. However, I've noticed that the opening and closing of the drawer happens very quickly and I would like it to have a slower transition. The usage of the ...

Can we ensure there is consistently an even number of columns when using auto-fill?

Hello, I am just starting to explore CSS grid. Take a look at the example below: .platform { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); grid-gap: 20px; } .item { width:100%; background-color:#aaa; padding:10 ...

Creating a visually appealing layout with three equal columns side by side in Bootstrap 4

I am trying to keep my CSS efforts minimal by utilizing Bootstrap for a simple layout. However, I am encountering an issue with a horizontal scroll. If anyone has a solution or can point out what I may be missing, please share. <!DOCTYPE html> < ...

How can I update an image source using JavaScript in a Django project?

Is it possible to dynamically change the image src using onclick without relying on hard paths or Django template tags? I have concerns that this may not be best practice. How can I implement a method to inject/change the ""{% static 'indv_proj&b ...

Clerk and Vitest Errors in Unit Testing

Currently, I am tackling a project at my workplace that has a strict requirement for unit tests. To fulfill this requirement, I opted to utilize Vitest and integrated Clerk for authentication purposes. However, I've encountered two distinct issues alo ...

Sending a GET request from PHP to React application

<?php header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET,PUT,POST,DELETE,PATCH,OPTIONS'); $con = mysqli_connect("localhost", "root", "", "demo"); ...

Sending data through AJAX

I am currently working on a calendar project. I want to include a description box next to the calendar, where additional information about an event will be displayed when a user clicks on a specific date. Here is what I have so far in terms of HTML/PHP: ...

Footnote fiascos

I am currently in the process of creating a footer for my webpage and have implemented the following CSS styling: #footer { height: 100px; background-color: #F3F3F3; position: absolute; bottom: 0; } Although the footer is displaying at th ...

Creating a "return" button for an editing form in AngularJS Datatables with the help of a form directive

Using AngularJS Datatables, I implemented a grid with additional "edit" and "delete" buttons in the last column. How is the grid/table rendered? HTML <!-- Required CSS and JS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/li ...

When a cursor hovers over an image, a dark line appears

I wanted to create a hover effect where the image would enlarge when hovered over. I achieved this using a JavaScript function that applies the transform property with a scale of 1.2 to the picture. However, during the animation, a black line appears at th ...

Update the CSS of a different element when hovering

Hello to all the jQuery developers out there! I have a question that's fairly simple. I'm trying to change a CSS attribute for an element when I hover over a different element on the page. I've created a fiddle for you to review, and I&apos ...

jQuery Slider not appearing on the page

I am attempting to incorporate the Basic jQuery Slider into my website. Below is the code I have used: For HTML file: <div id="slides"> <ul class="bjqs"> <li><a href="somelink"><img src="someim ...

The issue of the JQuery method failing to function properly on a button arises when the button is added

Upon loading a HTML page containing both HTML and JavaScript, the code is structured as shown below: <button id="test"> test button </button> <div id="result"></div> The accompanying script looks like this (with jQuery properly in ...

HTML5 for Bulk Video Upload

Is it possible to use the html5 api to record and upload video content directly from the browser? I am facing an issue in a project where the video recordings can be very long or large, causing extended upload times for users. Ideally, I would like the vi ...

Changing the color of HTML text based on a variable in Vue JS can be achieved by altering the CSS styles dynamically

I have developed a website that shows values with a set threshold. I now want to change the color of the values when they exceed the threshold, but I am unsure of how to proceed. I want to display consultation.indicateurs.TRS in red when it exceeds the va ...

What is the origin of the second parameter in an arrow function that returns another arrow function in a React component with Redux?

I'm having trouble understanding where the (val) parameter is coming from in the returned arrow function. I understand that max/minLength is an arrow function taking an argument set on the input field (3 and 25), and it returns another arrow function ...

When MUI Radio is selected, it passes both the label and value in the onChange event

I am currently working with reactjs and I have a MUI RadioGroup component. My goal is to pass the selected value's label along with it. Here is my Radio Button Code <RadioGroup aria-label="am-time-in" value={state.AM_time_in_valu ...

What is the best way to extract the first heading tags from a post and showcase the outcome?

Can someone help me with changing the_title() function to a heading tag that I manually input in posts? I have created a post loop list using table code but I am stuck at this point... Desired Title Format: <h3 style="text-align: center;">Title Here ...