Html 我如何在不修改填充的情况下在div中分隔img?

Html 我如何在不修改填充的情况下在div中分隔img?,html,css,Html,Css,我有一个Div,包含4个大小相同的图像,放在一行中。我希望它们保持在同一行,占据div中所有可用的空间,第一个图像在最左边,第四个图像在最右边,它们也必须等间距。我可以通过修改每个图像的填充来实现这一点,所以我想知道是否有一种方法可以自动完成 <div> <img src="imgsrc\html5.svg" id="htmLogo" class="iconPgr"> <img src="imgsrc\java.svg" id="javaLogo" clas

我有一个Div,包含4个大小相同的图像,放在一行中。我希望它们保持在同一行,占据div中所有可用的空间,第一个图像在最左边,第四个图像在最右边,它们也必须等间距。我可以通过修改每个图像的填充来实现这一点,所以我想知道是否有一种方法可以自动完成

<div>
  <img src="imgsrc\html5.svg" id="htmLogo" class="iconPgr">
  <img src="imgsrc\java.svg" id="javaLogo" class="iconPgr">
  <img src="imgsrc\python.svg" id="pythonLogo" class="iconPgr">
  <img src="imgsrc\C++ icon.png" id="cLogo" class="iconPgr">
</div>

您可以使用flexbox。请在此处阅读更多信息:

我的容器{ 显示器:flex; 证明内容:之间的空间; }
如果bootstrap可用并且您可以更改html,那么您可以将每个图像包装在一个div中,并使用bootstrap的网格系统

容器{ 宽度:100%; 边框:1px纯红; } .行{ 文本对齐:居中; }
请添加一个到目前为止您尝试过的代码示例。它是有效的,它是一个网格容器,这就是问题所在,因此我在其中使用flex属性创建了另一个div。
#htmLogo {
padding-left: 35px
padding-right: 0px

/* I repeat the same for every ID with different padding values so the imgs result equally spaced with htmLogo in the far right and cLogo in the far left */