新公司名称核准在哪个网站,韶关网站开发,网站上线如何做公司名字,起飞页怎么做网站问题
最近写一个布局的时候#xff0c;遇到一个问题。如下图的布局。在没有图片的时候布局是正常的#xff0c;如果有图片且设置了width:100%;height: 100%; 则会出现图片将自适应布局撑开的情况。
我的解决方式是让图片不缩放#xff0c;图片外层再添加一个div元素。形如…问题
最近写一个布局的时候遇到一个问题。如下图的布局。在没有图片的时候布局是正常的如果有图片且设置了width:100%;height: 100%; 则会出现图片将自适应布局撑开的情况。
我的解决方式是让图片不缩放图片外层再添加一个div元素。形如下图 大家有什么更好的方式麻烦告知我一下呗多谢
代码
!DOCTYPE html
htmlheadmeta charsetutf-8title/title/headbodystyle.container {display: flex;}.flex1,.flex2 {display: flex;flex-direction: column;margin-top: -5px;}.fixed-div {height: 100px;width: 200px;background-color: #f1f1f1;margin-right: 10px;margin-top: 5px;}.flexible-div {flex: 1 1 100%;height: 100px;width: 200px;background-color: #00aaff;margin-right: 10px;margin-top: 5px;}/stylediv classcontainerdiv classflex1div classflexible-div/divdiv classfixed-div/divdiv classfixed-div/divdiv classfixed-div/divdiv classfixed-div/div/divdiv classflex2div classflexible-divimg srchttps://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png alt //divdiv classfixed-div/divdiv classfixed-div/divdiv classfixed-div/divdiv classfixed-div/div/div/div/body
/html
效果