在CSS中浮动bug

时间:2018-05-07 05:26:39

标签: css

我试图让图片漂浮在文字上,但是它不起作用,文字每次出现在图像下面。

font-size是否与此有关。

或者图像尺寸可能很大。 我迷路了请帮我找出错误。

  .image flottante
     {
     float:right;
    }
    <p><img src= "image123.jpg" class="imageflottante" alt="image aleatoire" title="my picture"/>the paragraphe goes here </p>



   

2 个答案:

答案 0 :(得分:1)

您的样式规则不正确。它应该是这样的:

.imageflottante
{
    float:right;
}

答案 1 :(得分:0)

您在css中输入了错误的类名。您可以为类名称或HTML元素设置样式。就是这样。 通过使用类名:

.imageflottante{
  float:left;
}

使用HTML元素:

p img{
  float:left;
}