Prevent text from wrapping around awesomefonts image - html

I have an image that is displayed from an awesomefont character with text next to it. The problem I have is I don't want the text to appear under the image, but in right-justification to the right of the image. I've tried using a separate container and different types of alignment codes, but I can't get it to do what I need.
To view the problem, go to www.gibsonits.com and scroll down to the table of 6 points (2 rows, 3 columns). There you will see the text wrapping around the icon.

You need to add two divs side by side inside wrapper div. In first div, add font awesome icon and in second div add text. Look at working example here

Related

How to float images without stacking them?

I have a responsive design that mostly works. Images are in their own DIV, and that div is floated left or right. Captions for the images are in the div, so they stay with the image. By default image div width is set to 30%
If I put sufficient text between successive divs I get a pleasing display, with the text wrapping around the image.
If the images are too close, however they stack, and I end up with 2 images floating next to each other, and a tiny column of text.
The use of "clear" eliminates the text too.
Is there a way to float a div so that:
Text flows around it.
A second image does not stack adjacent to it even if there is nominally room for it.
In essence I want to float an image, but ensure that it is flush to the left margin, and not be on top of something else.
At this point my process is to try each page at multiple effective widths, and add more text/move the div as needed. This is fairly time consuming. I expect with a bit of time I will find out that I need X words between DIVS,
In some cases, I will stack multiple images within a single DIV. This works well for related images.
Example of a page with the issue about 3/4 of the way down the page.:
http://sherwoods-forests.com/Trees/Leaf_Trees/Poplars/Columnar_Poplars.html
CSS file for the site:
http://sherwoods-forests.com/2col.css
Put the floated image DIVs into the text container, not as a sibling to the text container. That way the text should float around it and won't be affected by a clear in one of the image DIVs.
If that doesn't work, you'll have to post your code - this general answer is all I can give you without the actual code...

Why is the img tag screwing up the vertical alignment from line-height?

I'm trying to vertically align some text in a div by setting the line height equal to the div height. This works just fine when there's just text in the div, and also when there's a small image in the div. But for some reason, when there's an image beyond a certain size in the div, it starts pushing the text downward. Check out this fiddle I made to demonstrate it.
In the fiddle are 4 divs that all have height: 40px and line-height:40px. The only difference is the the 2nd, 3rd & 4th divs also have images of size small, medium and large:
.small{height:20px;}
.medium{height:30px;}
.large{height:40px;}
So why are the third fourth images messing up the vertical alignment?
You need to add vertical-align: middle to your img tag, because it's not inline element, its inline-block element.
See updated Fiddle
Note that your vertical alignment method will not work when your text will be more than 1 row. Use for alignments flexbox, there are really good things :)
There a small space below every image. By default, an image is rendered inline (actually it's inline-block), like a letter. It sits on the same line that other letters sit on. There is space below that line for the descenders you find on letters like j, p and q.
You can adjust the vertical-align of the image to position it elsewhere. In this case vertical-align: middle; would be fine.
This answer describes the issue in details: Mystery white space underneath image tag
Vertical align is one of those things they never got quite right - try googling some articles around it.
My instant reaction here is to try vertical-align:middle on each of your images - but no guarantees - I've always had to experiment and you may get varying results from different browsers.
The only all-browser answer I've found is to create a 2-column table (maybe within the div box, but not necessarily) and put text in one cell (text is automatically vertically centred in table cells) then put the matching image in the next cell (which will automatically expand to the height of the image).
Aren't tables brilliant? (some people don't think so...)

Align an image within a <td> without it having to be a background

I'm trying to create a list of products using a <table> since it's basically a table with rows and columns.
I want to have one of the columns list whether the item status is available or unavailable, and I'd like to represent this with a little green icon if available, red if otherwise. I also want that icon to be clickable to change it.
So I Googled and found I might be able to position it if it's a background image, but I want it clickable, so that's no good.
I've tried all the vertical aligns and centers etc.. that I've read and tried margins and padding and all sorts but I can't get my little icon image to be in the middle (horiz and vert) of my little <td>.
To clear something up:
I just want to know how to align the image within the <td>. The image itself is the anchor, when its clicked, the page reloads and the icon chanages. I've tried positioning this image within the <td> but can't. That's my question: How to position it?
Not sure why you are having difficulty aligning your image within the table cell. Tables contain many helpful properties that help with alignment. Here's an example table with images aligned to the center of the table cell.
http://jsfiddle.net/Puppies4Life/zka5Q/
First of tables should only be used for data and a list of products isn't data. I'd recommend using either plain old divs or a UL with lots of floated LI elements.
For your icon it would probably be best to make it an 'A' tag and either have the icon sitting as an image in the 'A' tag or have it as a background to the 'A' tag.
To align it horizontally make it's parent container text-align:center.
I'll assume that each product is going to be an image and be a set height? If so then to align it vertically simply make the padding-top of the container the correct height to set it in the center.
Hopefully the above will work for you :)

Creating a dynamic bit of text in the middle of a paragraph

Essentially what I want to achieve is a a dynamic portion of text - in the middle of a paragraph, that is dynamic. I am having trouble creating an in-line div (or span) that can contain something like an unordered list or several other spans which I can move up or down to show them. Think a window (with overflow) that contains 4 divs stacked on top of each other, with only enough room to show one of them (the rest are hidden). I want to be able to move this stack up and down to show other parts of this stack.
I was hoping someone could reply with a jsfiddle that shows a big block of text with a dynamic portion in the middle of it, in line with the rest of the text in the paragraph.
You could start with something like this, using jQuery Draggable.
http://jsfiddle.net/RqHFL/
Apply the "draggable" to you div like this:
$( "#draggable1" ).draggable({ axis: "y" }); //constrained to y axis movement
After some consideration, vertical-align: bottom seemed to be my best friend.

How can I put text into a defined box?

jsFiddle
In this jsFiddle I've got two images and then some text. I want it to appear like this:
note: the images and text should be sitting on the same horizontal axis, the text is not supposed to be higher
So what I'm trying to do is make the text appear over multi-lines within a box with a width of 150. How can I do this?
Is this what you're trying to do?
As you can see I've only changed your CSS a bit by adding a display:inline-block to your text container.