How to set two image and text in same line

user6867831

I have a simple problem, how I could set image and text in a single line. like this [image - text - image] and so on

<html>
  <head>
    <title></title>
    <style>
      img {
        width: 100px;
        height: 100px;
      }
    </style>
  </head>
  <body>
    <img src="http://i164.photobucket.com/albums/u8/hemi1hemi/COLOR/COL9-6.jpg">
    <h1>afdsgdf dfgsdf dsfgf</h1>
    <img src="http://i164.photobucket.com/albums/u8/hemi1hemi/COLOR/COL9-6.jpg">
  </body>
</html>

kkaosninja

<img> and <h1> are block elements by default. So they will display their content on their own line.

So you need to use the display property. And set its value to inline

<html>

<head>
    <title></title>
    <style>
        img {
            display: inline;
            width: 100px;
            height: 100px;
        }
        h1 {
            display: inline;
        }
    </style>
</head>

<body>
    <img src="http://i164.photobucket.com/albums/u8/hemi1hemi/COLOR/COL9-6.jpg">
    <h1>afdsgdf dfgsdf dsfgf</h1>
    <img src="http://i164.photobucket.com/albums/u8/hemi1hemi/COLOR/COL9-6.jpg">
</body>

</html>

Read more about it here => https://developer.mozilla.org/en-US/docs/Web/CSS/display

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to set two block on the same line by middle?

From Dev

Text and Image in same line

From Java

How to set same alignment for these two text

From Dev

Display image and text in same line

From Dev

Arranging text and image in the same line

From Dev

Put text and image on the same line

From Dev

align image and text in same line

From Dev

How do I align text left and image right on the same line?

From Dev

How to align two text boxes on same line with CSS

From Dev

How to exclude text between two patterns in the same line

From Dev

Place a image view and a Text view in same line

From Dev

Force image to stay on the same line as text

From Dev

Force image to stay on the same line as text

From Dev

Can't get image and text to be on the same line

From Dev

Ionic header image and text not appears on the same line

From Dev

Placing image and text on same line in a span

From Dev

How to display text on the same line?

From Dev

How to display text on the same line?

From Dev

How to set a text line by line to multi line edit text

From Dev

How to set image and text on JRadioButton?

From Dev

How to set text over image?

From Dev

How to make 4 columns with images & text inside, and set links for each columns in the same line?

From Dev

How to set two property value using groovy in the same time from a text file

From Dev

How to put image and input on the same line with css

From Dev

How to display <p> in same line with image

From Dev

How to center a form that is on the same line as an image?

From Dev

How to adjust the top of an image and an input in the same line?

From Dev

How to ensure two words stay on the same line?

From Dev

How to use two let's on the same line?

Related Related

HotTag

Archive