How to place Text and an Image next to each other in HTML?

后端 未结 3 1230
情深已故
情深已故 2020-12-30 20:18

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. Thi

3条回答
  •  余生分开走
    2020-12-30 20:53

    You want to use css float for this, you can put it directly in your code.

    
    
    

    The Art of Gaming

    But I would really suggest learning the basics of css and splitting all your styling out to a separate style sheet, and use classes. It will help you in the future. A good place to start is w3schools or, perhaps later down the path, Mozzila Dev. Network (MDN).

    HTML:

    
      
      

    The Art of Gaming

    CSS:

    .myImage {
      float: left;
      height: 75px;
      width: 235px;
      font-family: Veranda;
    }
    .heading {
      float:right;
    }
    

提交回复
热议问题