为啥view里面的image上边距和左边距怎么调试都和view重合呢?有人知道怎么让image四周和view都有一定边距嘛?
image组件问题?image component problem?
image组件问题?为啥view里面的image上边距和左边距怎么调试都和view重合呢?有人知道怎么让image四周和view都有一定边距嘛?
Why does the upper margin and left margin of the image in the view coincide with the view? Does anyone know how to make the image and view have a certain margin?
回答:
所有HTML元素可以看作盒子,在CSS中,"box model"这一术语是用来设计和布局时使用。
CSS盒模型本质上是一个盒子,封装周围的HTML元素,它包括:边距,边框,填充,和实际内容。
盒模型允许我们在其它元素和周围元素边框之间的空间放置元素。
下面的图片说明了盒子模型(Box Model):
view { width: 300px; border: 25px solid green; padding: 25px; margin: 25px;}
给图片设置padding和margin都可以啊
原文出处:image组件问题?
css 外边距了解一下