HTML: Display DIV Box between words in line in regular text flow
Question by Guest | 2014-04-14 at 18:35
On my website, I have a text in which I would like to display some small images (for example smileys) between the words but in a line. The images are all stored in one big image. This big image is displayed in parts in small DIV boxes (CSS sprites).
Now, my problem is that I cannot make the DIV boxes staying in the regular text flow. Instead, they are breaking into the next line. Has someone an idea of how to do it?
Related Topics
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
jQuery: Show or hide DIV-Container depending on Checkbox State
Tutorial | 0 Comments
jQuery: Show a DIV - Hide other DIVs
Tutorial | 0 Comments
JavaScript: Show and hide HTML area by clicking a link
Tutorial | 0 Comments
jQuery: Load and Replace DIV Content with clicking Links
Tutorial | 0 Comments
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
CSS: Display Spaces and Paragraphs as in the HTML Code
Tip | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
For your purpose, a DIV box is not fitting, because a DIV is not an element that is appearing in the text flow. Instead, you should get to use the SPAN-tag. It is also possible to display parts of images within this tag but it is better suitable to be shown in line.
Your CSS class can look like this for example:
And in your HTML text, you can insert the image like that:
Above all, it is important to define "display: inline-block". Apart from that, you can adjust the height, width and background like you need it.
2014-04-16 at 18:15