Image in content block with CSS class?

Permalink
Hi guys,

Can someone tell me, if it's possible to put an image in a content block, and attach a specific CSS style to it?

I can't find anywhere to put in the css class or similar?

Thank you,

Jesper :)

View Replies:
Mnkras replied on at Permalink Reply
Mnkras
click on the block and click design, (5.4+ i think)
s2d replied on at Permalink Reply
s2d
What Jesper is asking (and I would like to know as well) is whether you can apply a css class to just an image WITHIN the content block, NOT the entire block.
s2d replied on at Permalink Reply
s2d
Actually, I do know one way to do this, by editing the raw html and applying the class to the img tag manually. But this is something I want the client to be able to do without having to type any html.

I did notice that you can apply a css id to an image within a content block, but not a class? ??? I would think a class would be used in a far greater majority of cases than an id.
s2d replied on at Permalink Reply
s2d
Got the answer. Yes, you can, and I feel a little silly now because I already knew about this.

1. Create a css file called typography.css. It should be located in the root directory ("folder") of your theme.
2. Define the classes you want to be able to apply to anything you include in a content block. When you do, these classes will appear in the "Styles" drop-down box in the TinyMCE content editor.
3. Apply your custom styles by selecting the "thingy" you want to apply the style to, then choosing it from the Styles list in the content editor.
uswebdesigner replied on at Permalink Reply
uswebdesigner
I tried this and could not make it work. I searched the forums and could not find anything that talks about this, only about complaints re how TinyMCE and the typography.css file don't do this or that. And could really use this.

Is there some trick to getting this to work?

Thanks,
uswebdesigner replied on at Permalink Reply
uswebdesigner
Never mind. Got it working. It turned out I had originally placed the typography.css file in a sub-folder and followed your instructions by moving back directly into the theme folder, but I had not uploaded it to the server. Woops! works.

Wow, what a gem of a tip.