473,796 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

seamless images tables in xhtml strict and css

The XHTML file below creates a 2x2 matrix of square images. There is
always some space at the bottom borders of the cells (when rendered
with Gecko and KHTML, not with IE) and I've found no way so far to
make it disappear. If I use XHTML 1.0 Transitional instead of Strict
the extra space below the cells disappears.

Is it impossible to create seamless images tables in XHTML Strict?

<?xml version="1.0"?>
<!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">
<head>
<style type="text/css">
table.puzzle{
border-collapse: collapse;
border: 1px solid red;
}
.puzzle td {
padding: 0;
}
img {
}
</style>
</head>
<body>
<table class="puzzle">
<tr>
<td><img src="p00.jpg" /></td>
<td><img src="p10.jpg" /></td>
</tr>
<tr>
<td><img src="p01.jpg" /></td>
<td><img src="p11.jpg" /></td>
</tr>
</table>
</body>
</html>

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 24 '05 #1
16 7666
Peter Maas <pe***@somewher e.com> wrote:
The XHTML file below creates a 2x2 matrix of square images.
Don't post code to the group, post a url of a minimized example that
demonstrates the issue.
There is
always some space at the bottom borders of the cells (when rendered
with Gecko and KHTML, not with IE)


Just a guess since your code would be useless to demonstrate the issue:
img{vertical-align:text-bottom} or another appropriate value.

Note that this is a style issue and should thus have been posted to
ciwas.

--
Spartanicus
Jul 24 '05 #2
Peter Maas <pe***@somewher e.com> wrote:
The XHTML file below creates a 2x2 matrix of square images. There is
always some space at the bottom borders of the cells (when rendered
with Gecko and KHTML, not with IE) and I've found no way so far to
make it disappear. If I use XHTML 1.0 Transitional instead of Strict
the extra space below the cells disappears.

Is it impossible to create seamless images tables in XHTML Strict?


Yes. This issue has nothing at all to do with XHTML Strict. The same
bahaviour can be seen if you used HTML Transitional with a doctype
that triggers standards mode.

In standards mode the browsers apply the CSS formating correctly. This
means that the image sits on the text baseline regardless of whether
there is any other text present or not. Some space must always be left
below the baseline.

To fix it make images block level elements. i.e. in your case
..puzzle img {display: block;}

Of course one has to ask why you are using XHTML Strict and what very
much seems to be a layout table. But the issue above will occur with
any element not just table cells so even when you move onto a
tableless layout you will still need to remember this.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 24 '05 #3
Peter Maas wrote:
....
Is it impossible to create seamless images tables in XHTML Strict?

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


...and the presence of the xml prolog will cause WinIE to go into
quirks mode. {Probably not what you want.)

http://www.quirksmode.org/css/quirksmode.html
about halfway down the page:

"Explorer Windows special: the xml prolog

In Explorer 6 Windows, Microsoft implemented one extra rule: if a
doctype that triggers strict mode is preceded by an xml prolog, the
page shows in quirks mode. This was done to allow web developers to
achieve valid pages (which require a doctype) but nonetheless stay in
quirks mode."

I wonder about that last sentence, though. <g> Was it really intentional?

--
-bts
-This space intentionally left blank.
Jul 24 '05 #4
Spartanicus schrieb:
The XHTML file below creates a 2x2 matrix of square images.

Don't post code to the group, post a url of a minimized example that
demonstrates the issue.


Sorry. I tried to make the code as small as possible. It is now
594 byte on 30 lines, about 18 sec download time on a 300 baud
acoustic coupler ;)
There is
always some space at the bottom borders of the cells (when rendered
with Gecko and KHTML, not with IE)

Just a guess since your code would be useless to demonstrate the issue:


It is a working example. If you talk about the images: one can grab any
local image and refer to it four times. Not that I intended anybody
to do this - I simply wanted to give a complete problem descrition.
img{vertical-align:text-bottom} or another appropriate value.
That does the trick, thanks!
Note that this is a style issue and should thus have been posted to
ciwas.


Sorry again. I thought that CSS and HTML are closely related. Is it
really necessary to split HTML related topics between separate news-
groups? This group seems to have about 40 postings/day, same in ciwas.
In comp.lang.pytho n we have 160 postings/day and nobody talks about
splitting.

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 24 '05 #5
In article <d3**********@s wifty.westend.c om>,
Peter Maas <pe***@somewher e.com> wrote:
The XHTML file below creates a 2x2 matrix of square images. There is
always some space at the bottom borders of the cells (when rendered
with Gecko and KHTML, not with IE) and I've found no way so far to
make it disappear.


http://www.mozilla.org/docs/web-developer/faq.html#gaps

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #6
Beauregard T. Shagnasty schrieb:
..and the presence of the xml prolog will cause WinIE to go into quirks
mode. {Probably not what you want.)


Thanks for the hint.

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 24 '05 #7
Henri Sivonen schrieb:
http://www.mozilla.org/docs/web-developer/faq.html#gaps


Thanks for the URL. Please don't think that I didn't do some searches
before posting here but I never used the word "gap" so I didn't find
this one :)

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 24 '05 #8
Steve Pugh schrieb:
Is it impossible to create seamless images tables in XHTML Strict?

Yes. This issue has nothing at all to do with XHTML Strict. The same
bahaviour can be seen if you used HTML Transitional with a doctype
that triggers standards mode.


I noticed that that I could switch this behaviour on/off by enabling
XHTML Strict/Transitional. So this *has* something to do with XHTML
Strict. I never claimed that his happens *only* with XHTML Strict :)
To fix it make images block level elements. i.e. in your case
.puzzle img {display: block;}
Thanks, this works! Henri Sivonen gave me an interesting URL with
some details about this behaviour.
Of course one has to ask why you are using XHTML Strict and what very
much seems to be a layout table.


Tables have been abused for years to solve layout problems they
weren't invented for. So I can understand that there is a sentiment
against using them. But I see no point in doing table-less HTML
just for the sake of itself. There are situations when a grid layout
is appropriate (e.g. to visualize relations) and the HTML tool for
this is the table tag.

I was creating a grid puzzle game so that tables were the natural
choice. I also tried a div based layout with absolute cell positio-
ning but this was clumsy because I had to hard-wire table dimensions
in CSS.

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 24 '05 #9
On Tue, 19 Apr 2005, Peter Maas wrote:
Steve Pugh schrieb:
Of course one has to ask why you are using XHTML Strict and what
very much seems to be a layout table.
Tables have been abused for years to solve layout problems they
weren't invented for. So I can understand that there is a sentiment
against using them. But I see no point in doing table-less HTML
just for the sake of itself.


Or to put it another way, I can understand that there's a sentiment in
favour of doing things the bad old way - but then why would one want
to move to Strict XHTML "just for the sake of itself"? One of the
aims of "Strict" (and that means HTML/4.01 Strict just as much as it
means XHTML Strict) was to get rid of presentational clutter from the
logical markup. So you got yourself a new dog but you're still
barking like the old one yourself, it seems.
There are situations when a grid layout is appropriate (e.g. to
visualize relations) and the HTML tool for this is the table tag.
I think you've got that back to front. The table is the tool to
*mark up* the logical relations. The "grid layout" follows naturally,
for presentation in the visual domain. But tables can be rendered in
other domains too, ones for which logical relations are important, but
visual layout is not (speaking browser, maybe some kinds of bot...)
I was creating a grid puzzle game so that tables were the natural
choice.


As far as I'm concerned, this is a discussion about theory. I'm
commenting on the discussion - not on your particular choice of markup
(sorry, I haven't time to see it in that much detail). If its the
right choice then please, feel free to go ahead. I'm just unhappy with
the cart-before-the-horse way in which you seem to be presenting the
principles of it.

Jul 24 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
2859
by: Firas D. | last post by:
http://www.firasd.org/scrapbook/poetry/robinson-edwin/minivercheevy.html This is probably wishful thinking, but it's worth a shot.. is there a way to put four different images on the corners of the bordered div? To make it look framed, kinda?
13
6132
by: DM | last post by:
If I put three images next to each other (each within an anchor tag) they all line up horizontally as expected with no space between them. I.e., they're sitting flush up against each other. However, in my design I need them to be laid out like this: XXXXXXXXooooooooo XXXXXXXXooooooooo XXXXXXXXooooooooo XXXXXXXXLLLLLLLLL
20
3152
by: Roberto | last post by:
Hallo, I'm building a page that wants to respect XHTML 1.0 strict and CSS2 specifics. In this page I have to present thumbnails arranged to cover the entire width of the window, but there are problems that are easier to see than to explain... http://www.wildzone.it/stage/thumbs/thumbs.php?galleria=samburu the CCS code is readable in a click. The document is correct in his xhtml and css sintax, and the code has been completely cleared from...
16
3477
by: Woodmon | last post by:
I want to flow text in an "irregular" column on the left and place a large image at the top of an "irregular" column to the right. Then after the bottom of the large image I want the text column on the left to expand part way to the right, but not all the way to the right, as I want a smaller image on the right. Then this will continue to the bottom of the page. The text needs to flow down in the left column. And the right edge of the...
3
1797
by: arbeizaf | last post by:
Hi: I am using CSS instead of tables for the layout of a webpage but I don't know how to do something. I need to place three images with the same distance among them and the border of the page. Something like this: --------------------------------------------- | |
0
2077
by: Jeb Hunter | last post by:
Well, how can I describe this succinctly? I have a page with DIVs that us background images to produce a border effect. It works perfectly well, but I want to make up (for now) 3 different border/background effects. Rather than duplicate the entire chunk of CSS 3 times, I thought "Gee, I should only have to specify the 3 backgrounds (all the other placement directives would be identical). However I must not be correctly specifying the...
7
6127
by: DesertPrince | last post by:
I like making pages with the XHTML strict doctype. So I was building a page where I have two images that need to be next to each other, one on top of the other, so the colors match up. In Firefox 2 and Opera 9 there was always a space in between. But not in IE7. You can see the effect at http://members.cox.net/desertprince/ Strict.html. If I change the doctype from strict XHTML to transitional XHTML the problem goes away. You can...
19
6184
by: marckatsambis | last post by:
Hi, I'm struggling to find answers on the problem I'm having, and I desperately need some closure :) I have a bunch of background-images in a css file that are visible locally, but when I upload to a remote server they won't show. I checked the actual link, which is correct (e.g '../images/main/ brc.gif'). To make sure I also tried the URL approach (e.g. 'http://
5
13384
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.