Forums

[resolved] Text around images (10 posts)

  1. Arabrab
    Member
    Posted 6 years ago #

    Since this afternoon I'm using the '15n41n1'-template by Isnaini Dot Com. I really love it, but there's just one thing I can't get to work and that's the oulining of the text around an image.
    I want the space between the image and the text to be 6px, so I fiddled a little in the CSS-file as the supportfile of WP showed me. But to my surprise it didn't work. Did I do something wrong?? Or am I just being incredably dumb?

    I typed in the css-file:
    img.right{padding: 4px; margin: 6px 6px 6px 6px; display: inline;}

    img.left{padding: 4px; margin: 6px 6px 6px 6px; display: inline;}

    I tried it like I copied it here, and with and . in front it and with # in front of it. None of it worked though.

    Anyone here????

  2. Chris_K
    Member
    Posted 6 years ago #

    Are you then editing your <img> tag to include what you've added in the style?

    Something like <img class="img.left" etc...>

  3. Arabrab
    Member
    Posted 6 years ago #

    It's sounds stupid, but I've no idea what you're asking me at the moment.

  4. moshu
    Member
    Posted 6 years ago #

    Wel, if you have that in your stylesheet, then in the code you should NOT use
    align="left"
    but give the class="left" to your images.
    .right or .left = they are classes!

  5. Chris_K
    Member
    Posted 6 years ago #

    Classes in CSS don't "just happen" :-) If you want an image tag in your post to use one of those classes you have a small/simple edit to do.

    First, add the image to the post.
    If using the old/non-wysiwyg editor, just edit the html for the img tag and add the class attribute as I illustrated earlier.
    If using the WYSIWYG/RTE editor, click the "html" quick button and add your class to the tag that way.

  6. Arabrab
    Member
    Posted 6 years ago #

    So I should put this in my CSS-file:

    .right {
    float: right;
    margin: 6px 6px 6px 6px;
    }
    .left {
    float: left;
    margin: 6px 6px 6px 6px;
    }

  7. moshu
    Member
    Posted 6 years ago #

    You could, but what we are trying to say is that in your post you have this:
    <img src="whatever.jpg" align="left"... />

    That code will NEVER use your classes from the CSS, unless you code it correctly:
    img src="whatever.jpg" class="left" ... />

  8. Arabrab
    Member
    Posted 6 years ago #

    I got it!!! It worked!!! Now I just have to remember to change the align-tag to class every time I use an image. :-)

    Thank you!!!!

  9. pdberger
    Member
    Posted 6 years ago #

    Hi. I have a similar problem to Arabrab. Since upgrading to 2.0.2. and using the WYSIWYG esitor there is no space between the image and the text.

    Rather than having to go into the html editor every time and changing the code from "align" to "class" is it possible to change the code in the stylesheet so that "align" works instead?

    I'm guessing the answer is no. In which case, is there a chance that future WYSIWG editors will have a "class" option as well as "align"?

    Best. And thank you for your help.

  10. stuff
    Member
    Posted 6 years ago #

    spacing around an image is done with:

    hspace=9 (pixels) sets text 9 pixels horz
    vspace=9 (pixels) sets text 9 pixels vertical

    put your value instead of 9, I use 5 and fround it looks nice.

Topic Closed

This topic has been closed to new replies.

About this Topic