Answer the question
In order to leave comments, you need to log in
How to force a div to float other elements
Good afternoon, you need to do the following
How to make a DIV marked with questions take into account that there is an image on the left? if you just insert it, then the div border starts from the edge of the parent DIV. and the picture just covers it. And I need the border of the div to be as shown in the picture.
PS: for some reason the picture is not visible, here is its address habreffect.ru/ff4/b5e029e79
Answer the question
In order to leave comments, you need to log in
something similar happened to be done by adding to the div
, but now the problem is that the text wraps around the problematic div. and I don't need it at all.
float: left;
width: 400px;
.container {
margin-left: auto;
margin-right: auto;
width: 960px;
}
.for_image {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
width: 440px !important
}
.for_text {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
width: 40px !important
}
Something like this... set the width for for_image to the one you really need...
give this div {overflow: hidden}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
div.block {}
div.block img {float: left;}
div.block div {overflow: hidden;}
/*]]>*/
</style>
</head>
<body>
<div class="block">
<img src="http://placekitten.com/200/300" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec posuere orci a dui egestas id lobortis nulla scelerisque. Mauris eu neque sed tellus vestibulum ornare. Vivamus malesuada venenatis lectus, sit amet feugiat quam pretium eget.</p>
<div>Donec sollicitudin justo et justo commodo</div>
</div>
</body>
</html>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question