Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

<DIV> elements & borders

9:37 pm on Nov 28, 2007 (gmt 0)

Junior Member

joined:Sept 3, 2007
posts: 59
votes: 0

Hi All,
I’ve upgraded to Dreamweaver CS3 from Dreamweaver 8. I see now that when I create a new <div> element and then drag an image into this box, and create a link to the image, I get a border around the image. The border is not there when there is not link associated with the image. This was not the case with Dreamweaver 8.
Can anyone explain how to get rid of this annoying border with the div element?

Below is the code example:
<div id="Layer7" style="position:absolute; width:349px; height:46px; z-index:4; left: 194px; top: 704px"><a href="homeInsurance.htm"><img src="Images/Nationwide/moreIns.gif" alt="More Insurance Options" width="323" height="40"></a></div>

The above code does do what I want, but I get a unwanted border.

Thanks in advance…


5:36 am on Nov 29, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Welcome aboard! :-)

It is natural for a linked image to add a border to identify it as a link, you need to do this:

<img src="moreIns.gif" alt="More Insurance Options" width="323" height="40" border="0">

Or style it as border: none in the style sheet. Chances are good you can set this as a default attribute for the img object somewhere in Dreamweaver's preferences.

3:50 pm on Nov 29, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:July 7, 2006
votes: 0

stick this at the top of the css file.

html, body, ul, ol, li, p, h1, h2, h3, h4, h5, h6, form, fieldset, a, img, blockquote, label, fieldset

this will specify that all images within the site have no borders without having to wrongly specify this in the html markup.

you can then create specific classes that you can apply to images to have borders.


border:5px solid #999;

which can then be called using:

<img src="/images/demo.jpg" alt="demo image" class="greywideborder />
4:01 pm on Nov 29, 2007 (gmt 0)

Junior Member

joined:Sept 3, 2007
posts: 59
votes: 0

God I love the Internet, you have a problem, someone out there has a solution!

That's for the input. I tied the "border" setting but apparently placed it on the href tag, not the image tag. Placing on the image source tag works!

So this must be the default using Dreamweaver 8, but not with the CS3 version?

Thanks again!