Text Wrapping an image using the...

User 2322012 Photo


Registered User
65 posts

I've pretty much quit designing web sites, which I used to love, since CSS and all the new technology HTML came along, but I was coerced into doing one more. I thought I'd be modern and start with a theme, but I'm having a lot of difficulties working with CSS or making any manual changes within the site because you can't do it like the old days... like tables and text wrapping and things I used to know. I realize I'd need a class in CSS, but I need to at least struggle through this new project first and it's needed right away.

My main problem is I want to simply insert an image on the page and have the text wrap around it starting at the top of the image, not at the bottom. I've searched the web all day, read CSS help files, tutorials etc but it's too deep for me and nothing has worked. Usually it just messes up something else when I attempt to make changes. Is there anyway to hard code the HTML to bypass the CSS and make this work?

I've tried this: The code below will align text to the top of an image entered alongside the text, and add a margin around the image so it has some space to breathe.

img {vertical-align: top; margin: 10px; }

But I could not find the correct place to use it I guess or the correct way.


Many thanks in advance
Tim
User 133269 Photo


Registered User
2,900 posts

try this...

<img src="my.jpg" style="float:left; margin:10px" />


add the CSS parts in the style="" bit of the image tag
Put the image before the text....
Have fun
~ Fe Pixie ~
User 2322012 Photo


Registered User
65 posts

Thanks, I'll give that a try. Oddly I noticed that when I preview the page in CC, it doesn't wrap. When I preview it in a browser (either one) it wraps, but no hspace or vspace, which doesn't work any more either. I hate it when they improve stuff. ;-)
Tim
User 2322012 Photo


Registered User
65 posts

Great, works like a charm. ;-)
Thanks
Tim

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.