Skip to main content
Participating Frequently
February 17, 2017
Answered

faint border on transparent background, but only when used in Dreamweaver

  • February 17, 2017
  • 5 replies
  • 3051 views

I created a logo for my client in Illustrator and 'exported for screens' with a transparent background. I've tried doing this creating a PNG file and also with an SVG file.

The problem I have is that when I use either of these files in Dreamweaver the image ends up having a faint gray outline, like the border of the artboard from Illustrator. This appears both in 'Live view' on my computer, but also when I preview it on my iPad or iPhone. If I 'place' this same image into InDesign the border does not appear. If I open it in Photoshop, the border does not appear.

I've read suggestions about eliminating the border in Photoshop, but since it does not appear there, doesn't seem to apply to this situation. I've also read that I should make sure that my Illustrator artboard is not aligned on partial pixels - did that, didn't help.

Here is a screenshot of what I'm seeing. The issue is the gray border that touches the logo.

Any suggestions about how I can either avoid this to begin with, or eliminate it afterward?

Thank you in advance.

This topic has been closed for replies.
Correct answer BenPleysier

Change

<header>

  <img class="logo">

</header>

to

<header>

  <div class="logo"></div>

</header>

The reason is that Chrome and a few other browsers normally place a grey border around an image if it can't find the image

5 replies

Participating Frequently
February 21, 2017

Thank you Ben, osgood, and Jon!

     Ben, your suggestion of using the <div> tag instead of the <img> tag did the trick! I had started out calling for <img src="#"> but then realized that this would cause a problem because the image file used for the logo changes depending on the size of the device. I neglected to properly change the entire structure of this code. But, now I know that the <img> tag automatically puts a gray border around an image!

osgood, thank you for noticing my faulty use of 'alt' instead of 'title' in my links - all fixed now.

And Jon, thank you for reminding me about code validation. When I did that it found some other faulty code relative to my favicon - all cleaned up now. The only thing I couldn't fix per the validation warnings was the use of pipe , "|" , between fonts called to from Google Fonts. That is the code provided/suggested by Google, and it seems to work. Any idea if there is another format that would work in this situations that would not cause validation issues?

Thanks everyone!

Tracy

Jon Fritz
Community Expert
Community Expert
February 22, 2017

You can replace each pipe character with %7C.

The link should look like...

https://fonts.googleapis.com/css?family=Open+Sans%7COpen+Sans+Condensed:300, 400, 700%7CPlayfair+Display%7CPlayfair+Display+SC: 400, 700

...and both go to the fonts and validate.

happie_97
Community Expert
Community Expert
February 21, 2017

You could try testing it by creating a css general rule that applies to all image borders or all linked image borders.

a img {

     border: none;

}

img {

     border: none;

}

Participating Frequently
February 20, 2017

Thank you Nancy and Fritz - sorry for the late response, I didn't see that you'd commented. I'm working on getting my host connection to work and then I will link this request to the site so that you can better see what I'm talking about.

I looked through my css and there doesn't appear to be any code that should be applying a border to this. If there was css that was more global it would be applying the border to the social media icons I'm using, and it is not.

Also, I found that the border shows up in Chrome and Safari, but when I view it on Firefox there is no border.

While we are waiting for my host connection to work, does this give you any more clues to what could be going on?

Legend
February 20, 2017

When you say the border does not appear in Photoshop have you zoomed right in close to the image?

Participating Frequently
February 21, 2017

Hi osgood,

I can't say that I have, but it clearly doesn't appear when 'placed' in InDesign, and when the site is viewed in Firefox the border is also not present. The border DOES appear when viewed on Chrome and Safari though.

If you want to take a look, here is a link to the site: Vern Vincent Consulting http://vernvincent.com/

Thanks for anything you can suggest,

Tracy

Jon Fritz
Community Expert
Community Expert
February 20, 2017

If it's not there in Photoshop or InDesign, it's likely being put on the image, or possibly the image's container by the css code of your page.

Look for a border setting in your css, something like...

border:2px solid gray;

If you have Firefox or Chrome, right click the image in the browser and choose Inspect Element, that will show you what css is affecting the image or container and which file it's coming from.

Nancy OShea
Community Expert
Community Expert
February 18, 2017

Can you upload your work to a remote web space you control (your web site) and post the URL?  The border could be coming from a parent HTML element.  We can't tell much from your screenshot.

Nancy

Nancy O'Shea— Product User & Community Expert
Participating Frequently
February 21, 2017

Hi Nancy,

Finally able to upload the site. Here is a link: Vern Vincent Consulting

As I mentioned to Jon and osgood below, the border on the logo image appears in Chrome and Safari, but NOT in Firefox. Hmmm...

If you can offer any suggestions, I'd appreciate it greatly!

Tracy

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
February 21, 2017

Change

<header>

  <img class="logo">

</header>

to

<header>

  <div class="logo"></div>

</header>

The reason is that Chrome and a few other browsers normally place a grey border around an image if it can't find the image

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!