WordPress.org

Forums

[resolved] How to: css align linked image to the right (5 posts)

  1. Please Add Screenshots
    Member
    Posted 1 year ago #

    I’m using this plugin to add a page’s content to my sidebar…
    http://wordpress.org/extend/plugins/page-in-widget/

    The page in question has an image that floats to the right and is linked. Unfortunately the image ONLY floats to the right if the image is unlinked. I don’t think it’s the plugin fault, It seems to be a css issue that I just can’t figure out?

    http://www.perthmetro.net/patio/perth-patios/gable-roof-patios-perth/

    Thanks, Pete

  2. greendemiurge
    Member
    Posted 1 year ago #

    I noticed that the content in your asdasda area is linked and floating correctly, but in the Contact Us area it is not.

    The main difference I can see between the areas is that the functional widget has its content wrapped in a div with class="textwidget". I'm not sure how that div got there, but when I add it in through chrome the image floats right like it is supposed to.

  3. Please Add Screenshots
    Member
    Posted 1 year ago #

    The top area content comes from a widget that is supposed to put a nominated page content, the bottom area is me just simply copying and pasting the html from that page.

    It appears the widget is somehow not letting the css align the image to the right??

    If anyone knows some css to get it aligned to the right that would be awesome !

    Thanks heaps

  4. ecdoesit
    Member
    Posted 1 year ago #

    Look for this CSS and remove the display: inline-block; or change it to 'inline'.

    #widgets a {
    display: inline-block;
    margin: 0;
    padding: 0;
    text-decoration: none;
    }

    The reason why the image in the second widget worked perfectly fine is because it has the following CSS to override the snippet above:

    #widgets .textwidget a {
    display: inline;
    }
  5. Please Add Screenshots
    Member
    Posted 1 year ago #

    Bingo, thanks heaps!

Topic Closed

This topic has been closed to new replies.

About this Topic