[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

floating image after text even when the text wraps

Posted on 2014-01-08
2
Medium Priority
?
200 Views
Last Modified: 2014-01-15
Hi,

I need an image to float right of a headline even when the text in the headline wraps onto another line.

<div style="width:100px">
<h3 style="float: left">headline text</h3>
<span stlye="float:left">background image placeholder</span>
</div>

At the moment I am having issues if the text wraps onto a new line the image no longer sits to the right of the text but instead sits underneath it. If the text is in one line it looks fine.

Thanks


Attached is a schematic example of what I need
example.jpg
0
Comment
Question by:Al4ddin2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Adrian Crabtree earned 1000 total points
ID: 39765965
Hi Al4ddin2, you can try setting the H3 to a display: inline. Here's a pen I created to illustrate that idea.

http://codepen.io/anon/pen/Dykuh
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 1000 total points
ID: 39765969
Since you are setting the container to width:100px there is no room for the image to float next to the text. An inline element will take up as much room as it needs - in this case the whole 100px before wrapping.
To get them on the same line you need to give the H3 tag a set width that allows enough room for the image to fit into the remaining width of the container
e.g.
http://jsfiddle.net/b9MCs/4/
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question