The lack of flexibility in this element stems from the fact that it is not classified as a flex item

I'm facing an issue with flexbox and its unusual behavior. I have set up flexbox for the parent element and used flex: 1 1 100%, but it's not working as expected. When I checked in Firefox Developer Tools, it says that the parent is not a flex container and suggests adding display: flex to the parent.

#dragable_container {
  display: flex;
  height: 20rem;
  background-color: red;
}

.box {
  flex: 1 1 100%;
  min-width: 20rem;
  min-height: 20rem;
  background-color: hsl(157, 90%, 35%);
  position: absolute;
}
<section>
  <div id="dragable_container">
    <div class="box" id="dragable"></div>
  </div>
</section>

Answer №1

the issue stemmed from my use of

position: absolute;

since position: absolute; alters the default content fitting behavior

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

What is the most effective method to extract an ID from a URL that is written in various formats?

Does anyone know of a reliable method to extract an ID from various URL formats using javascript or jquery? https://plus.google.com/115025207826515678661/posts https://plus.google.com/115025207826515678661/ https://plus.google.com/115025207826515678661 ht ...

Struggling to properly implement background images in a React application using Tailwind CSS

I'm currently developing a React application using Tailwind CSS for styling. In my project, I have an array of items called "trending," and I'm attempting to iterate through them to generate a series of divs with background images. However, I am ...

My React project is unable to import the foundation SCSS file into the App.scss file

After installing zurb-foundation using npm, I attempted to import the .scss file into my App.scss file. Utilizing the "live sass server" for compiling the .scss code into .css code, a .css file was generated but did not display any code despite successfull ...

Inconsistent functionality of HTML5 BrightCove videos on Android devices

Encountered an issue with the Brightcove HTML5 video embedded on my website showing a black screen when clicked to play. The video plays sporadically and only on Android Devices (testing on KitKat only). In instances where it doesn't work, the templa ...

Verify whether the content within the Div has been modified

I am currently making changes to content within a <div> element. I would like to determine if the data in the <div> has been modified and, if so, save it in a session to persist on refresh. How can I verify if the data has been edited and then ...

Items that do not commence from the start of the list

I'm encountering an issue with my unordered list where the li elements are not rendering properly. The first element seems to have a margin, and I'm unsure why this is happening. How can I fix this problem? function App() { return ( < ...

Implementing dynamic display of div based on dropdown selection in typescript

A solution is needed to display or hide specific div elements based on a dropdown selection using Typescript. Sample HTML file: <select class="browser-default custom-select"> <option selected>single</option> <option value="1"> ...

Incorporate a PHP file from an external website, as plain text or HTML

My dilemma involves a php file that resides on a particular website (for example: ). This script generates html content, primarily consisting of text formatted with tags like <h2>, <p>, and so on. The task at hand is to take this text and embe ...

Attempting to apply two different animations to a single element

Trying to implement two different animations, with one triggering before the other. In the Codepen and snippet below, you can observe that the initial animation rearranges the icons to their original positions upon page load. The second animation involves ...

Modifying a single element within a class with Jquery

Is it possible to create a stack of pages on a website using JQuery? I found this image that shows what I'm trying to achieve: image. Instead of applying ID css for each page, I'd like to use JQuery. While researching similar questions, I came ac ...

Is it possible to align a clip-path starting from the right edge?

On my webpage, I have a unique hamburger icon that is positioned 2rem away from the right and top edges. I am looking for a convenient way to create a clip path that grows from its center point. Calculating the center point is not difficult but unfortunate ...

The placement of the content in the Grid system seems to be off-kilter, not aligning properly with Bootstrap standards

I am facing an issue with the logo and navbar layout in my design. The design has 3 columns for the logo and 6 columns for the navbar, as shown in this image: https://i.stack.imgur.com/RpmJm.jpg However, when I run the code, they do not appear in the cor ...

Error found in Google's privacy page HTML code

Reviewing the html code of Google's Privacy Page, I observed the following header: <!DOCTYPE html> <html lang="en"> <meta charset="utf-8> <title>Google Privacy Center</title> <link rel="stylesheet" href="//www.g ...

Steps to disable all fields if the previous field is set to its default value and the default value is currently selected

As a newcomer to AngularJS, I have successfully disabled fields based on previous field selections. However, my goal is to set the default value of "ALL" for all fields (country, state, city). If the country value is set to "ALL," then the state and city ...

jQuery Mobile - Implementing Persistent Toolbars along with a custom back button functionality

UPDATE Here is a fiddle of the problem: https://jsfiddle.net/9k449qs2/ - attempt to select the header using your picker, but every time you click it will select the whole page instead. I am currently working on a project that includes a persistent header ...

Is it possible to utilize a hyphen in the link_to attribute?

I'm encountering a dilemma in my Rails app where I need to assign a value to a custom data-* attribute for an anchor tag. The issue is that hashes can't contain hyphens, leading to difficulties with this code: <%= link_to 'Example', ...

Several pictures are not displaying in the viewpage

I have a controller method set up to fetch files from a specific folder. public JsonResult filesinfolder(ProductEdit model) { string productid = "01"; string salesFTPPath = "C:/Users/user/Documents/Visual Studio 2015/Projects/root ...

I seem to be having trouble locating the element using its xpath

I am in search of the xpath element below. What would be the xpath? precise location (GPS and network-based) Below is the HTML code: <div class="permission-bucket" jsinstance="1" jstcache="75"> <div class="bucket-icon-and-title" jstcache="87"&g ...

Creating dynamically adjustable columns in Bootstrap

I've created a simple code for experimentation purposes: <!doctype html> <html lang='en'> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" ty ...

Is there a way for me to adjust the font size across the entire page?

Most CSS classes come with a fixed font-size value already set. For instance: font-size: 16px font-size: 14px etc. Is there a way to increase the font size of the entire page by 110%? For example, font-size: 16px -> 17.6 font-size: 14px -> 15.4 ...