WordPress.org

Ready to get started?Download WordPress

Forums

How to remove the image border, I have been searching for hours (5 posts)

  1. alanli713
    Member
    Posted 7 months ago #

    website http://www.ktop.co.uk/

    I have been searching for hours for the right code to remove the image border, I have changes most of the img under style.css in to border: 0px, but still cannot remove the ugly black border.

    Thank you

  2. Jorge
    Member
    Posted 7 months ago #

    The reason why - from my observation is - your code is:

    border: none;

    Try the following:

    border: 0px !important;

    The reason why your styling doesn't work is because your style.css comes before and is overwritten by the violet.css stylesheet.

    Hope this helps.

  3. alanli713
    Member
    Posted 7 months ago #

    what about custom css? which is come first?

  4. WPyogi
    Volunteer Moderator
    Posted 7 months ago #

    Custom CSS should load later - and you should not be modifying theme files anyway - as your changes will be lost when the theme is updated.

    Using !important is not good coding practice, so that's really not an ideal solution.

    Try this:

    .post img, .type-page img,
    ul.products li.product img {
       border: none;
    }
  5. Jorge
    Member
    Posted 7 months ago #

    All custom stuff should be loaded last. The !important is perfectly fine to use if you need something quick. For production though, do as the previous poster wrote.

Reply

You must log in to post.

About this Topic