image组件问题?

小程序 文章 2022-02-11 15:20 226 0 全屏看文

AI助手支持GPT4.0

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?

回答:

微喵网络:

css 外边距了解一下

陈宇明:

所有HTML元素可以看作盒子,在CSS中,"box model"这一术语是用来设计和布局时使用。

CSS盒模型本质上是一个盒子,封装周围的HTML元素,它包括:边距,边框,填充,和实际内容。

盒模型允许我们在其它元素和周围元素边框之间的空间放置元素。

下面的图片说明了盒子模型(Box Model):

view {    width: 300px;    border: 25px solid green;    padding: 25px;    margin: 25px;}
小黎:

给图片设置padding和margin都可以啊

-EOF-

AI助手支持GPT4.0