Forums

[resolved] Removing border in functions (7 posts)

  1. Broomy
    Member
    Posted 3 years ago #

    I've got some functions which display data with links like this:

    echo __('<img src="'.get_settings('siteurl').'/wp-content/plugins/report_posts/flag_red.png" style="margin-right:10px" alt="Flag this post" />') . '';

    How can I remove the border that appears around the images; i've tried adding border="0" but no luck.

    Thanks for any help.

  2. podz
    Support Maven
    Posted 3 years ago #

    Have you tried changing the stylesheet / css?

  3. Broomy
    Member
    Posted 3 years ago #

    Hi podz, what would I need to look for as i'm not sure what would control the border of a linked image.

    Thanks for your help.

  4. Yosemite
    Member
    Posted 3 years ago #

    If that works (from your post):
    echo __('<img src="'.get_settings('siteurl').'/wp-content/plugins/report_posts/flag_red.png" style="margin-right:10px" alt="Flag this post" />') . '';

    Then this should show it without borders:
    echo __('<img src="'.get_settings('siteurl').'/wp-content/plugins/report_posts/flag_red.png" style="margin-right:10px;border:none;" alt="Flag this post" />') . '';

    But Podz is right, you should try to keep styles in the stylesheet ;')

  5. Broomy
    Member
    Posted 3 years ago #

    So would something like this be the best option:

    echo __('<img src="'.get_settings('siteurl').'/wp-content/plugins/report_posts/flag_red.png" class="postoptions" alt="Flag this post" />')

    With the css like this:

    .postoptions {
    margin-right:10px;
    border:none;
    }

    Probably a basic question, but then I really am basic at css!

    Thanks for your help.

  6. Yosemite
    Member
    Posted 3 years ago #

    Yes, that looks good...

  7. Broomy
    Member
    Posted 3 years ago #

    Ah good, thanks for your help Yosemite and podz :-)

Topic Closed

This topic has been closed to new replies.

About this Topic