Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nomade

macrumors member
Original poster
Dec 2, 2006
72
0
I use tiny MCE to allow user to add formatting and photo to their text.

When I present the texte I use css to format the text.
Code:
.texte { color: #022b55; font-size: 14px; border-right: 10px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; line-height: 18px; text-align: justify; margin: 15px; }
I would like to apply a right margin to the image inside the text.

You can see the result here : http://annemariejobin.net/fr/creativite.php?texte=6

I'm stuck on this one, any suggestion will be welcome.:confused:

Nomade
 
Thanks jaikob,

That would be fine if I can apply a class to the image itself. But if a apply margin-right: 5px to the class that will apply to the text as well.

What I would like to do is to apply a right-margin only to the image.

Nomade
 
That would be fine if I can apply a class to the image itself. But if a apply margin-right: 5px to the class that will apply to the text as well.

Reread the CSS, it will only be applied to the img tag that exists inside tags with the class of texte.
 
Sorry to both of you, I didn't understood that I have to create a new class.
Now it work perfectly.

Thanks a lot.:D
 
Sorry to both of you, I didn't understood that I have to create a new class.
Now it work perfectly.

Thanks a lot.:D

Umm, no, I'm glad it's working, but that's not what they were saying. .texte (the class you already have) is the parent of the img you're trying to put the margin. So, you can use the parent/child selector method:

parent child { style }

Thus:

.teste img { margin-right: 5px }

tells the browser to look for img tags inside of the .teste class and apply a right margin of 5px to it.

No new class needed.

jW
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.