Jump to content

Floating images in text editor


opalepatrick
 Share

Recommended Posts

Hi opalepatrick

When you align it adds a style to the element that floats left or right.

In the original download for PW in the styles css you have the following:

.align_left {
        float: left;
        margin: 0 1em 0.25em 0;
}
 
.align_right {
        float: right;
        margin: 0 0 0.25em 1em;
}
 
.align_center {
        display: block;
        margin-left: auto;
        margin-right: auto;
}
 
Those are the styles used in the editor which you can customise as you wish.
 
If you want to add more style information you can use JQuery to addClass to your element as part of your template.
 
I normally make sure that when  I do a template, where I am using a RTE field I wrap that in a div with a unique class or ID so I can identify things like the <a> element that is wrapped round the image and add various bits to it. So, for instance, if I were using fancybox and needed to add the class and the group attribute, I would wrap the output in a div called blog then use the jquery
 
$('.blog img').closest("a").addClass("fancybox ").attr('rel', 'group');
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...