How can I remove the black border around all images. Id like to have it off by default, and if i want one i can use the border tag in the html. Does anyone know how i can do this?

Comments

heine’s picture

What theme / module do you use? On my site with image.module and image_assist images are enclosed in the div class 'image'. You can set the style for such a class using CSS (to get rid of a border, get rid of border*: value; in .image). But this very good HTML/CSS guide might help you as well.

From the info you give I can't determine exactly what element is styled however; it could be the img element itself.

EDIT: To my knowledge image.module doesn't contain any CSS that defines borders, it's merely an example
--
Tips for posting to the forums

800series’s picture

I'm just writing to bump this article with the current date, since it TOTALLY helped me figure out how to SELECTIVELY border images -- along with a complementary article, which I've linked below. Thank you, Drupal.org posters!!

The dichotomy here may seem like I'm being facetious; I'm not. I am completely serious. With these two articles combined, I now have total flexibility as to which of my inline images have borders (and what kind), and which don't. Very, very sweet indeed.

This article: "Get rid of image border"
http://drupal.org/node/39190

Companion article: "Adding an image border"
http://drupal.org/node/59964

cre8d’s picture

In your theme's stylesheet add:

img { border: none; }

Update...or follow Heine's advice :)

HAMM3R’s picture

I looked in style.css for my theme (which is called 'leaves'), and I found this:
img{
border: none;
}
So it seems it's already there, however when i use the Only local images are allowed. html code to display an image, even when i define 0 as the border i still get a 1px black border around all my images.

cre8d’s picture

Have you got a URL? Are your images links too?

dhakajack’s picture

I had the same issue with thumbnails created by the img_assist module. I also scratched my head for a bit wondering where the class was defined that was mentioned within the <img> tag -- it just wasn't used by my theme. However, by process of elimination, I found the culprit. The image was surrounded by a <span> which used the class "inline" which is defined in the img_assist.css file (and even helpfully commented):

.inline img{
  border: 1px solid #000; /* put a thin border around inline images */
}

I overrode this class in my style.css (which is loaded last). Result: no more border.

800series’s picture

I'm just writing to bump this article with the current date, since it TOTALLY helped me figure out how to SELECTIVELY border images -- along with a complementary article, which I've linked below. Thank you, Drupal.org posters!!

The dichotomy here may seem like I'm being facetious; I'm not. I am completely serious. With these two articles combined, I now have total flexibility as to which of my inline images have borders (and what kind), and which don't. Very, very sweet indeed.

This article: "Get rid of image border"
http://drupal.org/node/39190

Companion article: "Adding an image border"
http://drupal.org/node/59964