WordPress.org

Ready to get started?Download WordPress

Forums

Img caption, wrap, link, and align (4 posts)

  1. wfc_fiona
    Member
    Posted 2 years ago #

    Hello,

    When I add a caption to an image, the text no longer wraps. I've read several other forum threads about the same problem and have tried their suggestions, to no avail. Eg.:

    .wp-caption.alignleft { float:left; margin-left:0; margin-right:5px; }
    .wp-caption.aligncenter { margin-left:auto; margin-right:auto; }
    .wp-caption.alignright { float:right; margin-left:5px; margin-right:0; }

    In addition, even without caption, I was hoping to get rid of the img link but then the text no longer wraps.

    Last thing, the images won't align anything but left. The code currently looks like this:

    .format_text img.left { margin: 0 10px 1.53846em 0; float: left; clear: none; }
    .format_text img.right { margin: 0 0 1.53846em 10px; float: right; clear: none; }

    and on the suggestion of another forum thread I added this to the end but no dice:

    .alignleft, .post .alignleft{float: left;}
    .alignright, .post .alignright{float: right;}
    .aligncenter,div.aligncenter,.post .aligncenter{display: block;margin-left: auto;margin-right: auto;}

    The page in question uses 'Neoclassical' theme and is: http://power-to-the-people.net/

    Any help very much appreciated! Thank you in advance.

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    http://codex.wordpress.org/Wrapping_Text_Around_Images

    add the styles from the above codex chapter into custom.css of your theme.

    however, this line:

    .format_text a img { margin: 0 15px 0 0; float: none; clear: none}

    about in the middle of style.css is stopping any attempts of aligning images;

    remove that line;
    or add these in custom.css:

    .format_text img.alignright {float:right; margin:0 0 1em 1em; }
    .format_text img.alignleft {float:left; margin:0 1em 1em 0; }
    .format_text img.aligncenter {display: block; margin-left: auto; margin-right: auto; }
  3. wfc_fiona
    Member
    Posted 2 years ago #

    Thanks very much for the reply. I've removed

    .format_text a img { margin: 0 15px 0 0; float: none; clear: none}

    and added

    .format_text img.alignleft {float:left; margin: 0 1em 1em 0}
    .format_text img.alignright {float:right; margin: 0 0 1em 1em}
    .format_text img.aligncenter {display: block; margin-left: auto; margin-right: auto}
    .alignright {float:right}
    .alignleft {float:left}
    .aligncenter {display: block; margin-left: auto; margin-right: auto}

    But the problem seems to remain. Am I still doing something wrong?

    Cheers, Fiona

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    occasionally, you need to clear the browser cache - depending on your browser, try to 'reload' the web page a few times, or press 'CTRL F5' ...

    I can see that is has worked, the image in the top and bottom post on the front are aligned left with the text wrapping; the middle post's image has no alignment assigned, so it just sits at the start of the text.

Topic Closed

This topic has been closed to new replies.

About this Topic