Support » Fixing WordPress » Targetting image to remove border

  • Dot

    (@dianetingleyhotmailcom)


    Hello,

    I have the code for putting a grey border around my images in my 2014 child theme. However, there is one I think would look better without one (the first, picture of an acorn here: http://www.acornhats.co.uk/).

    How do I remove the border of that picture, leaving the other pictures’ borders intact, please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • the image has a specific CSS class, which you could either find out by investigating the html ouptut of the site in your browser, or by using a browser inspection tool.

    for example, this is the start section of the post containing the html code with the image:

    <p><span style="font-family: Arial;"><a href="http://www.acornhats.co.uk/wp-content/uploads/2014/05/acorn-hat1.jpg"><img class="aligncenter size-medium wp-image-645" src="http://www.acornhats.co.uk/wp-content/uploads/2014/05/acorn-hat1.jpg" alt="acorn-hat1.jpg" width="1" height="1" /></a><br />
    <a href="http://www.acornhats.co.uk/wp-content/uploads/2014/06/ah-printsmlr.jpg"><img class="aligncenter size-medium wp-image-998" src="http://www.acornhats.co.uk/wp-content/uploads/2014/06/ah-printsmlr-300x300.jpg" alt="ah printsmlr" width="300" height="300" /></a> </span></p>
    <p>Ah asserts  a speici.....

    from that, you can see that the image has the specific CSS class .wp-image-998

    you can then use CSS like this to hide the border:

    img.wp-image-998 { border: none; }

    Thread Starter Dot

    (@dianetingleyhotmailcom)

    Thanks Alchymyth: it worked, and I’ve learnt something there 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Targetting image to remove border’ is closed to new replies.