Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-18 02:14:45

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

text wrap around an image

sorry i put this into the wrong section

is there a way to make text wrap around an article image in the excerpt and body?? i searched and found 1 post but it didnt help :(

Last edited by blazin6543 (2006-07-18 03:42:35)

Offline

#2 2006-07-18 04:35:16

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: text wrap around an image

<a href=“http://textpattern.net/wiki/index.php?title=Txp:article_image_/”>TextBook</a>

Use the <code>align</code> attribute, which accepts the same values as the equivalent IMG tag would.

<em>Never mind. See below.</em>

Last edited by Elenita (2006-07-18 05:17:41)

Offline

#3 2006-07-18 04:52:53

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

Re: text wrap around an image

do you mean put align=“left” on article_image? because i tried that and nothing…. unless you mean something completely different

Offline

#4 2006-07-18 05:04:54

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: text wrap around an image

use float.

Offline

#5 2006-07-18 05:16:39

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: text wrap around an image

Walker’s right. You should probably use a CSS rule, as the align attribute has been depreciated anyway.

Offline

#6 2006-07-18 07:31:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: text wrap around an image

<txp:article_image style="float: left;" />

Offline

#7 2006-07-18 15:00:09

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

Re: text wrap around an image

ok thanks tons the float works great….. but now …. if there isnt a lot of text the next article actually comes up as well … both articles are to the right of the image instead of just the one and the next article being on a new line…. anyway to fix that? :(

Offline

#8 2006-07-18 15:02:53

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,350
Website GitHub Mastodon Twitter

Re: text wrap around an image

have a <code>clear:both</code> css rule in between articles


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2006-07-18 15:58:45

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

Re: text wrap around an image

im sorry but im not that experienced with css i just started using it probably a month or so ago :( where exactly do i put the clean rule? also i want to add that the comment form follows the body so it l00ks a little odd

Last edited by blazin6543 (2006-07-18 15:59:43)

Offline

#10 2006-07-18 16:11:56

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: text wrap around an image

<blockquote>1 more thing ;) the text of the body is rubbing right against the image is there a way to pad or use a margin? i tried adding padding to the body but no go :(</blockquote>

You would have to use the <code>margin</code> attribute, like: <code><txp:article_image style=“float: left; margin: 5px;” /></code>. Margins define the space around elements, and padding define the space between an element and its border.

(Quick question for those more knowledgeable than me: has the <code>align</code> attribute for the <code><txp:article_image /></code> been depreciated?)

Last edited by Elenita (2006-07-18 16:12:40)

Offline

#11 2006-07-18 16:18:40

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

Re: text wrap around an image

ya i actually figured that margin part out thats why i edited my post ;) thanks anyways though….. still unclear about the clear:both though

Offline

#12 2006-07-18 16:21:28

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: text wrap around an image

Following certain forum threads on here, I did it this way:

In my CSS I added:
<pre>img.content { margin: 6px 6px 0 4px; padding: 0 6px 0 4px; float: left;
}</pre>

In an article I use:

<code><txp:image id=“95” class=“content” /></code>

It works for me but I’m open to other alternatives.

Offline

Board footer

Powered by FluxBB