Heath wrote:
Sorry, but I have tons of questions tonight, but I will post them one by
one.
Using i.e. 6+ and NS 7+
How do you set properties for a pictures from a style sheet?
For example:
<img name="Picture"></img>
The closing tag for <img> elements is forbidden. In HTML, just omit it. In
XHTML, use the empty element syntax:
<img src="..." alt="..." />
<style>
img ??? {
width: 400px;
}
</style>
Is that possible? I have tried all the variations I could think of
img.Picture, #Picture img, img.#Picture, I know you can set properties
for all images by using img {}, but that is as far as I can get. Any
help is appreciated.
If you mean how do you select one particular image, in CSS 2 conforming
browsers, you can simply use an attribute selector:
<img src="foo.png" alt="..." />
img[src=foo.png] {
/* Whatever you want here. */
}
However, Internet Explorer is broken and has a large market share, so you'll
have to use an id:
<img src="..." alt="..." id="bar" />
img#bar {
/* Whatever you want here. */
}
Alternatively, if you want to select a group of images, a class would be
more appropriate:
<img src="..." alt="..." class="baz" />
img.baz {
/* Whatever you want here. */
}
Consult any CSS tutorial for information on how you can select elements in
different ways, or better yet, consult the definitive source, the CSS 2
specification:
<URL:http://www.w3.org/TR/REC-CSS2/selector.html>
--
Jim Dabell