Welcome to WebmasterWorld Guest from 54.242.63.214

Forum Moderators: not2easy

Message Too Old, No Replies

<DIV> elements & borders

     

Meat Curtian

9:37 pm on Nov 28, 2007 (gmt 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…

MC

rocknbil

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

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



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.

kolin

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

5+ Year Member



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
{
margin:0;
padding:0;
border:0;
}

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.

i.e.


.greywideborder
{
border:5px solid #999;
}

which can then be called using:


<img src="/images/demo.jpg" alt="demo image" class="greywideborder />

Meat Curtian

4:01 pm on Nov 29, 2007 (gmt 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!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month