Page 1 of 1
Images with CSS
Posted: Fri Oct 22, 2004 9:43 am
by Archy
Is there a way to define images with CSS, such as set the borders of all images to 0 etc? Any help would be nice.
Thanks.
Posted: Fri Oct 22, 2004 10:04 am
by nigma
Yes, there is
Code: Select all
img {
border: none;
/* other style rules here */
}
Posted: Fri Oct 22, 2004 11:26 am
by Archy
Ofc, how stupid of me :\
Is there a way to get the alt tags in that as well, I tried...
Code: Select all
img {
border: none;
alt: text here;
}
... but it did not work. Any ideas, or will I have to enter all of them all into the picture manually (Sigh).
Thanks.
Posted: Fri Oct 22, 2004 12:12 pm
by zenabi
CSS doesn't work like that I'm afraid, you'll have to enter the "alt text" in your HTML code.
Posted: Fri Oct 22, 2004 2:08 pm
by nigma
The whole point of css is to seperate content from presentation (data vs. how the data is displayed). The alt attribute is meant to describe the picture which is being displayed, therefor it's data and has no place in css.
If are intent on giving all images the same description you can use php. But this defeats the purpose of the element and why it's required in order for a page to be valid xhtml.
Posted: Fri Oct 22, 2004 7:11 pm
by no_memories
Each new version of (x)html deprecates more of the hhml attributes than the previous version relying more and more on css to layout or presentation.
Basically xhtml is html housing of text in an xml fashion and then styled using css. common tags in html 4.01 like align and height will no longer be valid in say xhtml 1.1 within most html elements. Now that xhtml 2.0 is on the horizon, xhtml proves to be even more modular and reliant on css and other forms of presentation to display the site.
Let's hope the browsers start nailing down css the way it should be, fully supporting the 2.1 standards, and working very hard to support the 3.0 standards. But Microsoft is hell bent on holding back the Internet with I.E. 6 by not upgrading or improving the browser.