Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
How can I make text appear next to images in entries (instead of underneath or above)?
Posted: 26 June 2005 07:12 PM   [ Ignore ]  
Summer Student
Total Posts:  18
Joined  2005-02-24

If i add an image to entries that i publish the text is always shown underneath the image while i would like to make it appear next to the images that i publish in my entries. So my question is: How can I add images to entries without leaving a white space next to the image in the entry when it’s published?

The following site shows the way I want to display my entries (text and an image combined in each entry):
http://www.geenstijl.nl/

Here’s an example of what happens now when i add an image to an entry with pMachine:
http://www.martijnvanosch.nl/comments.php?id=87_0_1_0_C

Thanks in advance.

Martijn

Profile
 
 
Posted: 27 June 2005 01:13 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  2005-01-05

You need to add a css class to your image tag and “float” the image.

.image {
float
: right;
margin: 10px 0 10px 10px; /* adds a margin to the top, left, and bottom of the image to give some space between it and the image */
}

<img [b]class="image"[/b] src="http://www.martijnvanosch.nl/images/uploads/log_hondshirt.jpg" border="0" width="240" height="240" />

Depending on your setup you might be able to get away a more generic declaration, without having to class every image.

.weblog p img {
float
: right;
margin: 10px 0 10px 10px; /* adds a margin to the top, left, and bottom of the image to give some space between it and the image */
}

That says every image that appears in a paragraph, that appears in the column with the class “.weblog” will have those styles attached.

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 27 June 2005 02:24 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  18
Joined  2005-02-24

Thanks smallbeer!

Just adjusted the css and it works.  :-)

Martijn

Profile
 
 
Posted: 27 July 2005 09:03 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  4
Joined  2004-05-15

You are wonderful!! Thank you! It worked.

Profile
 
 
Posted: 16 August 2005 01:39 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  13
Joined  2002-07-11

I have the same problem with floating images—in Firefox the images look fine, but in IE the picture just disappears.  (Example here.)

Sometimes I don’t mind posting the picture on its own with no text alongside it (like here —image is at the bottom), and other times I want the image to float.  So I am probably better off using the .image tag for specific weblog entries.

My only question is—where specifically would I put that css tag?  I tried to put it in the beginning of the entry, using <style> tags (is that right?), but it didn’t work—again, looked fine in Firefox, no joy in IE.  Thanks in advance!

Profile
 
 
Posted: 21 August 2005 10:34 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  13
Joined  2002-07-11

Bump—still can’t get my image to float.  Smallbeer’s advice is to add css class to the image tag.  I want to give that a try but I don’t know how.  Do I post this css class in the weblog entry when I upload the image?  Am I supposed to add it to the existing css for weblog.php?  Somewhere else?

Profile
 
 
Posted: 26 August 2005 09:09 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2360
Joined  2002-12-06

Stennie -

There’s two basic steps:

#1.  Adding a declaration in your CSS file.

#2 - Referencing that declaration from the image HTML from within the entry.


#1 - Here’s some code that I’ve used, and it works both in FF and IE.  This floats the images right and also adds a background and border for a “framed” effect:

.right {
float
: right;
padding: 3px 3px 3px 3px;
border: 1px solid #ADBFCB;
margin-left: 10px;
margin-top: 10px;
background: #E0E0E0
}

#2 - Here’s the Image code from within an entry:

< img class="right" src="/images/content_images/replicj7bottom200.jpg" height="121" width="175" alt="replicj7bottom200" />

 Signature 

Sign up for Southern Fried ExpressionEngine - a 4-day EE class in San Antonio, TX starting on January 20th.

Profile
 
 
Posted: 27 August 2005 02:42 AM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  13
Joined  2002-07-11

Hi, Michael—

Thank you for your response.  I added the “right” declaration to the CSS file (also a “left” one), and the class tag to the post entry.  Unfortunately—still not showing up in IE!  Take a look.

One thing I noticed is that when adding class=“left” to the <img> tag, because of the way pmachine auto-codes image tags, it wouldn’t allow me to put the class tag before the src, so I put it after.  Would that make a difference?

Profile
 
 
Posted: 27 August 2005 08:12 AM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2360
Joined  2002-12-06

Stennie - I was able to get the image to appear and float right in IE by doing the following:

-add this to your right and left image css declarations:

position: relative;

-putting the class=“right” into the img tag (which you can do by editing the code that pM drops in for you after uploading the image).

The root cause was a “layering” issue with the center column and the image….

 Signature 

Sign up for Southern Fried ExpressionEngine - a 4-day EE class in San Antonio, TX starting on January 20th.

Profile
 
 
Posted: 27 August 2005 12:01 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  13
Joined  2002-07-11

Yaaaaaaaaaay!  THANK YOU so much, Michael, that worked—I really appreciate your help.

Profile
 
 
Posted: 28 August 2005 07:35 PM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2360
Joined  2002-12-06

Glad it worked.  CSS is pesky sometimes..wink

 Signature 

Sign up for Southern Fried ExpressionEngine - a 4-day EE class in San Antonio, TX starting on January 20th.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 64515 Total Logged-in Users: 0
Total Topics: 81075 Total Anonymous Users: 0
Total Replies: 436312 Total Guests: 16
Total Posts: 517387    
Members ( View Memberlist )
Active Members: