Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

strict DTD vs border=0 attribute

Jul 27, 2007 2:30PM PDT

hello, I just changed the dtd in all my pages to strict, and the only thing i couldnt get around was that the w3c's validator says border=0 (for an image) is not valid within a strict dtd document, so how could i get around this?

keep the strict dtd and have no borders around my pictures?


thanks, Marcelo.

Discussion is locked

- Collapse -
Yes.
Jul 28, 2007 7:40PM PDT

I have no knowledge of XHTML yet but looking into your problem it seems that, unless a border needs to be specified, then you leave the border attribute out.

This is an example I found and it suggests that border is no longer just border="1", etc. Instead it is a style, included in style sheets if the attribute is to be global, otherwise specified in pixels and a color, eg;

<body>
<p>
<img id="img1" src="image1.gif" style="border: 5px solid green;" width="100"
height="100" alt="border test">
</p>
</body>

Does that help?

Mark

- Collapse -
of course
Jul 29, 2007 3:44AM PDT

yes what I'll do is just put this code in my style sheet
img {
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}

and that will apply to all the images, and if I want one to have a border I'll create a class.


thanks!

- Collapse -
(NT) Yep that looks good.
Jul 29, 2007 4:11AM PDT