Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 将图像置于Div的中心_Css - Fatal编程技术网

Css 将图像置于Div的中心

Css 将图像置于Div的中心,css,Css,好吧,我知道这已经被问了一百万次了,但我用的是通常的技巧,它不起作用 代码如下: 我需要驾驶人的图像集中在圆形分区内 我的代码: <div style= 'margin: 0;margin-left: auto;margin-right: auto;display: block;'> <img src='http://fantasy-f1-league.com/images/drivers/Carlos_Sainz_Jr.png' width = '90'>&l

好吧,我知道这已经被问了一百万次了,但我用的是通常的技巧,它不起作用

代码如下:

我需要驾驶人的图像集中在圆形分区内

我的代码:

    <div style= 'margin: 0;margin-left: auto;margin-right: auto;display: block;'>

<img src='http://fantasy-f1-league.com/images/drivers/Carlos_Sainz_Jr.png' width = '90'></div>
很多代码都不是我的,我使用的Dragula是基于我发现的一个演示的,我想其他一些CSS可能超过了我要做的

谢谢。

您可以使用flex:

将此添加到保存图像的div中:

display: flex;
justify-content: center;
更新的提琴:

请在你的问题中贴一个帖子