• I’m using the origin theme and have a child theme setup to make modifications to it. One bit of css is causing all my images to revert to their default size though.

    .hentry img, .entry-content img, .widget img, .wp-caption {
    height: auto;
    padding: 1px;
    border: 1px solid #E5E5E5;
    }

    I want to make it so the line “height: auto;” isn’t read in the child template somehow. Overwriting it wont do because that still specifies a value. I want to remove the line from consideration entirely.

    I know I should be using css to set the image size but this has come up before and I would like to know how it works.

    Thanks!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you sure the images aren’t re-sizing server-side and therefore cannot be reverted back to their original size through CSS?

    Thread Starter Chopperdave

    (@chopperdave)

    They are reverting to their original size. I have a text widget (using it for some html) in a sidebar with an image in it. I have the size of the image set in the html but it is being reverted to its original size by the css. I can remove that line of css and it will go back to the size I want.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Oh I understand, what should the size be?

    Thread Starter Chopperdave

    (@chopperdave)

    I want it to be 35 x 35px and it is set to that in the html. I just need a way to set it to ignore that line in the parent style.css file.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Which one of these selectors, .hentry img, .entry-content img, .widget img are you using?

    Thread Starter Chopperdave

    (@chopperdave)

    .hentry img

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Have you tried;

    .hentry img {
     width: 35px;
     height: 35px;
    }

    In the child stylesheet?

    Thread Starter Chopperdave

    (@chopperdave)

    Yes, and that works, but that will overwrite all the images with height and width of 35. I don’t want to overwrite the css I want to be able to ignore a line. This has come up a couple times for things other than height and width of images so it would be good to have a solution for all occasions.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’ll have to use CSS selectors specific to the elements you want.

    I have exactly the same question and I note that it hasn’t been answered here. I don’t really want to start another topic so I am going to try requesting an answer here. Can anyone PLEASE answer the question (copied from above):
    I don’t want to overwrite the css I want to be able to ignore a line.

    Please …….

    Please see the forum guidelines –
    http://codex.wordpress.org/Forum_Welcome#Where_To_Post

    It’s unlikely that you have the identical issue – CSS is entirely theme and site specific – so please start a new thread and include a link to your site for help with CSS questions.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Also if you think your query hasn’t been answered, don’t demand it to be answered. These forums are entirely volunteer-based. Perhaps you have expectations more suitable for someone you’ve hired? If so, consider posting at WP Jobs instead.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Remove CSS in Child Theme’ is closed to new replies.