Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Edit:</strong></p> <p>I originally skipped over the fact that you provided some HTML and CSS in the question, so in my original answer I just went off the image provided. Looking at the HTML and CSS you provided, the only thing you'd have to do to get the desired result is set a negative bottom margin in your CSS on the <code>img</code> tag. Here's a <kbd><a href="http://jsfiddle.net/4d9Xk/3/" rel="nofollow"><strong>jsFiddle</strong></a></kbd> using your original markup with the only significant addition to the CSS being the negative bottom margin set on the <code>img</code> tag.</p> <p>The added benefit of doing it this way is that the image will stay in the desired spot (extended slightly below the <code>div</code> that contains it), even when adding more lines of text to the paragraph (<code>p</code>) changes the height of the containing element (<code>.page div</code>).</p> <p><strong>CSS</strong></p> <pre><code>.page { width:500px; margin:0 auto; padding: 5px; width: 100%; background-color: #ED1C24; border-top: 3px solid black; border-bottom: 3px solid black; text-align: center; } .half { display:inline-block; width:44%; margin:0 2%; } img { margin-bottom:-50px; } </code></pre> <p><strong>Original answer:</strong></p> <p>You could just position the image below the text, float the image, and set a negative top margin on the image to make it cut back into the element containing the text. This way, the image will keep sitting in the right spot, even when adding more lines of text changes the height of the containing element.</p> <p>Here's a <kbd><a href="http://jsfiddle.net/4d9Xk/1/" rel="nofollow"><strong>jsFiddle</strong></a></kbd></p> <p><strong>HTML</strong></p> <pre><code>&lt;p&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt;Text &lt;br/&gt; &lt;img /&gt; &lt;/p&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>p { width: 100%; background-color: #ED1C24; border-top: 3px solid black; border-bottom: 3px solid black; text-align: center; } img { width: 100px; height: 100px; background-color: yellow; border: 3px solid black; float: right; margin: -70px 100px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload