As said in title just want to make my image appear side by side to the text in the "title" element
<!doctype html>
<html>
<head>
<style>
.logo {
box-shadow: 0px 0px 5px white;
border: 1px solid #cccccc;
display: inline-block;
width: 30%;
}
.main{
width: 100%;
padding: 20px;
}
.element{
background-color:#3c3B37;
}
.title {
display: inline-block;
overflow: hidden;
margin-left: 50px;
border: 1px solid #cccccc;
background: linear-gradient(90deg, #cccccc, white);
}
.title p {
margin: 6px;
}
</style>
</head>
<body>
<div class="main">
<div class="element">
<img class="logo" src="img_snow.jpg" alt="snow" />
<div class="title"> <p>Lorem Ipsum is simply
dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown
printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the
1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop pub
</p></div>
</div>
<div class="element">
<img class="logo" src="img_forest.jpg" alt="forest" />
<div class="title"> <p>Lorem Ipsum is simply
dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown
printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the
1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop pub
</p></div>
</div>
<div class="element">
<img class="logo" src="img_mountains.jpg" alt="mountains" />
<div class="title"> <p>Lorem Ipsum is simply
dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown
printer took a galley of type and scrambled it to make a type specimen book.
2
It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the
1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop pub
</p></div>
</div>
</div>
</body>
</html>
here’s the output I’m getting
enter image description here
tried using display in-block to make the images in the "logo" element appear in rows side by side to the text in element "title" but instead seperated them into two different inline-blocks
2
Answers
Try this:
Just modified below code
easiest way is to use float, that’s what it was built for!