locked
Format an image and 3 rows of text RRS feed

  • Question

  • User206383436 posted

    I am new to CSS and I need to place an image to the left and 3 rows of text to the right of the image.
    How can I achieve this?

    Best regards.

    Tuesday, January 9, 2018 7:53 PM

Answers

  • User2103319870 posted

    I am new to CSS and I need to place an image to the left and 3 rows of text to the right of the image.
    How can I achieve this?

    You can try with below code

    <!DOCTYPE html>
    <html>
    
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <style>
          .divcss {
            display: inline-block;
          }
          
          .imgcss {
            width: 200px;
            height: 150px;
            display: inline-block;
            vertical-align: top;
          }
    
        </style>
      </head>
    
      <body>
        <img class="imgcss" src="Picture.jpg">
        <div class="divcss">
          <p>Row 1</p>
          <p>Row 2</p>
          <p>Row3 2</p>
        </div>
      </body>
    
    </html>
    
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 9, 2018 8:13 PM

All replies

  • User2103319870 posted

    I am new to CSS and I need to place an image to the left and 3 rows of text to the right of the image.
    How can I achieve this?

    You can try with below code

    <!DOCTYPE html>
    <html>
    
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <style>
          .divcss {
            display: inline-block;
          }
          
          .imgcss {
            width: 200px;
            height: 150px;
            display: inline-block;
            vertical-align: top;
          }
    
        </style>
      </head>
    
      <body>
        <img class="imgcss" src="Picture.jpg">
        <div class="divcss">
          <p>Row 1</p>
          <p>Row 2</p>
          <p>Row3 2</p>
        </div>
      </body>
    
    </html>
    
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 9, 2018 8:13 PM
  • User206383436 posted

    Thanks. This is what I was looking for. I´ve got a very good idea and I even made some small adjustments.

    Best regards.

    Tuesday, January 9, 2018 11:40 PM