homepage Welcome to WebmasterWorld Guest from 54.161.247.22
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
<DIV> elements & borders
Meat Curtian




msg:3515664
 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




msg:3515885
 5:36 am on Nov 29, 2007 (gmt 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.

kolin




msg:3516241
 3:50 pm on Nov 29, 2007 (gmt 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
{
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




msg:3516253
 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!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved