Note that there are some explanatory texts on larger screens.

plurals
  1. POFloating images to the right of text in CSS below <h3> tags
    primarykey
    data
    text
    <p>I'm not sure if anyone else has had this problem. I am trying place an image below an headline (and above a paragraph) and float it to the right of the text and place a 10px margin to the left of the image. In my CSS style-sheet I have clearly selected the image and applied the 'float: right' property but the image still seems to stay on the left below the headline when I refresh the webpage.</p> <p>The only solution I can find is in response to blog post ('floating right an image alongside an H3 tag'), - which suggests adding a rule to the HTML after the image code. But this defeats the whole point of CSS. What if I want to apply this rule on multiple pages of my site?</p> <p>My HTML is as follows:</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet"href="css/style.css" type="text/css" media="screen"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="header" class="grid_11"&gt; &lt;h1&gt;Birthdays&lt;h1&gt; &lt;h2&gt;Perfect Fun-Philled Events&lt;h2&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;div class="post"&gt; &lt;img src="img/birthday cookie.jpg" class="pic"&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo imperdiet libero, id dapibus lorem viverra sit amet. Phasellus eleifend diam a erat viverra nec sodales orci feugiat Maecenas molestie nisl at erat lobortis commodo non nec lectus.&lt;/p&gt; &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_rwCJzc5dlWA/TPV7v1QQZsI/AAAAAAAAAjk/MgRY11AGuBA/s1600/PA300421.JPG"&gt;Original photo available here. &lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And the corresponding CSS:</p> <pre><code>#content { float: left; width: 700px; margin-right: 20px; } #content .post { background: #FFF; padding: 10px; margin-bottom: 20px; border: 4px solid #DA6; color: #420600; } #content .post h3 { margin: 0; color: #420600; } #pic { float: right; margin-left: 10px; border: 4px solid #FFF; } </code></pre> <p>I would be grateful if anyone has any suggestions!</p>
    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.
 

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