XHTML and tables with images as background or cells with only images strange behaviour |
XHTML and tables with images as background or cells with only images strange behaviour |
boost2029 |
Apr 21 2011, 05:28 PM
Post
#1
|
Group: Members Posts: 2 Joined: 21-April 11 Member No.: 14,383 |
Hello nice people!
My skills at html and css are poor so please forgive my sure dumb question. I have added html code and css stuff to a web page of mine, and in order to get this new code working, I needed to add this: CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb"> doing this certainly solved my problem but raised a new one, as a table that before looked ok now looks bad, as the cells are now bigger than they where. The cells from the table have images inside or have a image as background. I mean this: CODE <tr> <td style="height: 10px; width: 10px"><img border="0" src="screen_top_left.gif"></td> <td background="screen_top_middle.gif"></td> <td style="height: 10px; width: 10px"><img border="0" src="screen_top_right.gif"></td> </tr> what am I missing? To fix one thing I screwed another, is it possible to have both the xhtml stuff activated and the table looking ok as before? thanks a lot and have a good day! Juan |
pandy |
Apr 21 2011, 07:02 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
What you did evoked Standards Mode (AKA as Strict Mode) in browsers. It isn't the XML per se. See http://hsivonen.iki.fi/doctype/ .
I think you need to post the URL to the page for us to be able to help. There must be something else involved, maybe in the CSS. |
Darin McGrew |
Apr 21 2011, 07:11 PM
Post
#3
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
In what browser do you see this? Could it be the problem described here?
https://developer.mozilla.org/en/Images,_Ta...Mysterious_Gaps |
pandy |
Apr 21 2011, 07:16 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Probably. I forgot that takes Standards Mode.
|
boost2029 |
Apr 22 2011, 06:14 AM
Post
#5
|
Group: Members Posts: 2 Joined: 21-April 11 Member No.: 14,383 |
Hey Darin thanks a lot!
At the first attempt to fix the problem using the methods sugested in the article you posted the table looked again as before. I only had to add "td img {display: block;}" in the css file and voila! thanks much for sharing your knwoledgement it helped a lot! Juan |
Lo-Fi Version | Time is now: 26th April 2024 - 08:38 AM |