I have a container that contains three elements: one image and two divs:
I want all images to be inline blocks and have specified so in their classes:
.first_image {
display: inline-block;
height: 20px;
width: 20px;
}
.first_div {
width: 100%;
display: inline-block;
}
.second_div {
width: 52px !important;
height: 40px !important;
display: inline-block;
background-color: #3798D4;
}
.container {
display: inline-flex;
}
However, when I run and inspect, these are the actual attributes:
- The container (class case-input is .container)
- The first image
- The first div
- The last div (this one has class
.edit_pen_container
and contains a button)
The issue is that 1. displays as flex
although it should be inline-flex
, 2., 3., and 4. display as block
although they should be inline-block
. I really don't see why it changes. Also, the property is not crossed out, so it doesn't seem to be overridden.
By the way, so you can understand my logic, img
will stay there, div 1 has a width of 100% because it has to take the rest of the div. When a user puts the mouse in div 1, div 2 appears and will take a fixed width (52px) and div 1 will shrink to allow div 2 to take the space it needs. Maybe my logic is wrong but this is what I want to do.
All HTML elements have been added through javascript, so I don't have a DOM hierarchy to show.