如何在html中将图像放在最左边?

问题描述 投票:-3回答:2

我尝试使用左对齐,但它仍然在中心。我想要最左边的图像。我试过在CSS中做这个,但我找不到正确的方法来做到这一点。我是这一切的新手。

html css html5 web
2个回答
0
投票

你可以添加你的CSS:

img {
  float: left;
}

将所有图像放在左侧。如果你想要一些特定的图像添加类。


0
投票

试试你的.class img

.class img {
  float:left;
  text-align:left;
}
© www.soinside.com 2019 - 2024. All rights reserved.