Say you want to have an image (or any other element) visually float left into a paragraph of text. But like… in the middle of the paragraph, not right at the top. It’s doable, but it’s certainly in the realm of CSS trickery!

One thing you can do is slap the image right in the middle of the paragraph:
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing
<img src=”http://css-tricks.com/tree.jpg” alt=”An oak tree.” />
elit. Similique quibusdam aliquam provident suscipit
corporis minima? Voluptatem temporibus nulla
</p>
But that’s mega awkward. Note the alt text. We can’t have random alt text in the middle of a sentence. It’s semantically blech and literally confusing for people using assistive technology.
So what we have to do is put the image before the paragraph.
<img src=”http://css-tricks.com/tree.jpg” alt=”An oak tree.” />

<p>
Lorem ipsum dolor sit amet consectetur, adipisicing
elit. Similique quibusdam aliquam provident suscipit
corporis…


This is only a snippet of a Website Design Article written by Chris Coyier

Read Full Article


Content Disclaimer 

This Content is Generated from RSS Feeds, if your content is featured and you would like to be removed, please Contact Us With your website address and name of site you wish to be removed from.

Note:

You can control what content is distributed in your RSS Feed by using your Website Editor.

Tech Shop Offers