This question already has answers here:
Stretch image in iron-image element
(4 answers)
Closed 7 years ago.
Check out this jsbin
I want my images have auto height with sizing="contain", it means they won't have extra space. In my example those extra space are in red.
iron image is required to set a fixed height otherwise image not display, I tried height:auto and height:100% but not work.
I was using paper-material, should use paper-card
Related
This question already has answers here:
img max-width with percentage how does it work?
(4 answers)
Closed 1 year ago.
I know that to make an image responsive but not scaled up beyond its original size, all we have to do is setting max-width: 100%. But I am not sure why that setting works because literally it just tell the browser the image cannot exceed the width of the parent container, instead of the original image size. Could anyone please explain the reasons behind?
Consider a 1000px wide image in a 400px wide div. max-width 100% prevents the image from exceeding the size of the div.
This question already has answers here:
CSS when inline-block elements line-break, parent wrapper does not fit new width
(2 answers)
Make container shrink-to-fit child elements as they wrap
(4 answers)
Closed 1 year ago.
We have text-elements with defined spacings in between them. They can be multiline.
Now if the text breaks inside of them, width:auto is not correct - it somehow should be recalculated after the text broke onto new lines.
Current situation:
Desired situation:
I created a simple fiddle for it: https://jsfiddle.net/zd73vfne/
max-width: 260px
is just for demonstration purposes, so the text breaks.
Using word-break is not an allowed solution per requirement.
I've added another example with multiple boxes next to eachother, which shows the problem even better: https://jsfiddle.net/zd73vfne/2/
Is there a pure CSS solution?
This question already has answers here:
Pin element like position: fixed but inside its parent not the viewport
(3 answers)
Closed 4 years ago.
I'm building table that should be fully responsive (so I'm using flex on divs instead of table).
I want to be able to pin column.
Here what I've got https://codepen.io/piernik/pen/LmoBxM
What's the problem?
When You scroll left pinned column disapears.
It's probably that .row2 has width of viewport, not entire table.
You can see .row2's width on the red top border.
Can I fix it?
I want to build responsive table with pinned column that can have hsrcoll without any JS.
You used flex-basis:500px in cell that's why your table width larger than windows width and flex cover only all window width.
This question already has answers here:
repeat css background image a set number of times
(7 answers)
Closed 9 years ago.
I have an image that I am using as a divider that is basically a colon (:) repeated across the page, however instead of going all the way across I only want it to go about 80% or around 700px. Is there some CSS to set how far the image repeats?
How about putting the image in a div that is 700px wide and set the background image repeat-x to 100%?
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Remove white space below image
I have this page HERE. All four boxes with the images (one long horizontal and 3 smaller ones at the bottom) all have empty space below the image and above the bottom border. If I make these boxes have a pixel height it goes away but I need to leave it at auto because its a responsive site (work in progress). I cannot figure out what I'm missing. Any suggestions would be great!
CSS is HERE
Thank You!!!
You can set the images inside those boxes to:
display: block
That should solve it.