英文:
height: fit-content; not working by firefox
问题
开发工具告诉我,Firefox 不支持 fit-content。有人可以告诉我应该写什么来替代 fit-content 吗?
.main--5 {
position: relative;
max-width: 100%;
background-color: var(--firstColor);
height: auto; /* 用 auto 替代 fit-content */
opacity: 100 !important;
visibility: visible !important;
pointer-events: auto !important;
display: block;
display: none;
padding: 1.6rem;
overflow-y: hidden;
}
英文:
The dev tool tell me that the fit-content not working by Firefox. Can someone say what should I write instead fit-content.
.main--5 {
position: relative;
max-width: 100%;
background-color: var(--firstColor);
height: fit-content;
opacity: 100 !important;
visibility: visible !important;
pointer-events: auto !important;
display: block;
display: none;
padding: 1.6rem;
overflow-y: hidden;
}
答案1
得分: 2
请查看 caniuse 网站以获取有关 CSS 兼容性的问题。<br/>
如在此页面所解释,您可以使用 -moz-fit-content。<br/>
您还可以在父元素上使用 display:flex,并在子元素上使用 flex-grow:1。
英文:
Please take a look at caniuse website for CSS compatibility questions.<br/>
As explain on this page, you can use -moz-fit-content.<br/>
You can also use
display:flex
on parent and flex-grow:1 on child.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论