473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gap Above Table with Strict Doctype

My page has a table which sits directly underneath an image. The
background colour of the table matches that of the image, so they visually
combine.

Now, when I view the page in Firefox with the strict doctype tag[*]
specified, a gap is inserted above the table.

If I don't specify a doctype, however, this gap isn't present.

Any ideas on how to work around this?
[*]:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Jul 23 '05 #1
7 3961
In article <12************ ****@cool.guy.a bc.xyz>, co*****@abc.xyz enlightened
us with...
My page has a table which sits directly underneath an image. The
background colour of the table matches that of the image, so they visually
combine.

Now, when I view the page in Firefox with the strict doctype tag[*]
specified, a gap is inserted above the table.

If I don't specify a doctype, however, this gap isn't present.

Any ideas on how to work around this?


Browsers have default paddings and margins for most elements - and they won't
be the same across browsers or in/out of quirks mode (no doctype sets quirks
mode). Specify a class or ID for the table, then in the CSS, set paddings and
margins to 0 for that class or ID.

i.e.
<table class="myNoPadd edClass">

or

<table id="header">

then [1]
table.myNoPadde dClass {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

or

#myNoPaddedClas s {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

HTH

[1] Note that I have never used strict doctype and don't know if you can use
this shortcut or if you need to do each side, like padding-top, padding-left,
etc.

--
--
~kaeli~
Humpty Dumpty was pushed!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
In article <12************ ****@cool.guy.a bc.xyz>,
Cool Guy <co*****@abc.xy z> wrote:
My page has a table which sits directly underneath an image. The
background colour of the table matches that of the image, so they visually
combine.


You are either seeing the issue discussed in
http://www.mozilla.org/docs/web-developer/faq.html#gaps
or you are seeing a default margin. (I should add a note about margins
to the FAQ.)

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 23 '05 #3
Els
kaeli wrote:
#myNoPaddedClas s {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

HTH

[1] Note that I have never used strict doctype and don't
know if you can use this shortcut or if you need to do each
side, like padding-top, padding-left, etc.


I only use Strict doctype, and have no problems with the
shorthand style :-)
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Smokey Robinson And The Miracles - The Tears Of A
Clown
Jul 23 '05 #4
Previously in comp.infosystem s.www.authoring.html, kaeli
<ti******@NOSPA M.comcast.net> said:
padding: 0px 0px 0px 0px;
padding: 0;
margin: 0px 0px 0px 0px;


margin: 0;

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 23 '05 #5
Cool Guy wrote:
My page has a table which sits directly underneath an image. The
background colour of the table matches that of the image, so they
visually combine.

Now, when I view the page in Firefox with the strict doctype tag[*]
specified, a gap is inserted above the table.


It actually is under the image, not above the table.

img { margin:0; }

HTH
Markus
Jul 23 '05 #6
Els
Markus Ernst wrote:
Cool Guy wrote:
My page has a table which sits directly underneath an
image. The background colour of the table matches that of
the image, so they visually combine.

Now, when I view the page in Firefox with the strict
doctype tag[*] specified, a gap is inserted above the
table.


It actually is under the image, not above the table.

img { margin:0; }


If it is under the image, you might also wanna try
img{display:blo ck;}
or
img{vertical-align:bottom;}

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Deep Purple - Highway Star
Jul 23 '05 #7
Els wrote:
Markus Ernst wrote:

img { margin:0; }


If it is under the image, you might also wanna try
img{display:blo ck;}
or
img{vertical-align:bottom;}


Huh... I must have been sleeping while writing, of course I meant
display:block.. .

--
Markus
Jul 23 '05 #8

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

Similar topics

2
2017
by: Tony T | last post by:
I'm not a regular here - strictly an amateur web developer - but I've got so frustrated I'd really appreciate any help anyone can give. I'm working on a PC platform with Win ME. I'm developing a new set of web pages, using html4.01 strict with css2 stylesheets. As part of the design, I need to be able to monitor and measure the vertical scrolling of my document in the viewport. I have got this to work with up-to-date Netscape and Opera...
4
5501
by: David Ross | last post by:
In my <http://www.rossde.com/inflation.html>, I have a small table in the middle of the page. This page is composed without a DOCTYPE statement at the beginning. The table borders appear to my browser (Mozilla) as raised with a slight shadow to the right and below. The borders are specified with the "border" attribute in the <table> tag: <table border cellpadding=2 width="100%"> and not via a style sheet. If I add a DOCTYPE...
20
3040
by: Tyler Carver | last post by:
I would like to do something that seems so basic with two div's but I don't think it can be done. Tables can do it in a snap. I was convinced that css was the way to go for layout but without being able to do even the easiest things, I don't see how. Here is the table way to do the layout (I want this to work in compliance mode in all modern browsers.): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"...
3
1460
by: Ernst | last post by:
I have a script for a menu. However, this menu uses absolute coordinates. This menu had to be placed on a website. This website is position (centered) using a table. How can I determine/calculate where to fix my menuregardless the browser, slidebar width, tool etc. Thanks Ernst
7
1959
by: Arthur Dent | last post by:
I am completely baffled... i cannot for the life of me get the HEIGHT style to work on a table in the new 2005-supported XHTML. I put a HEIGHT: 100% on my table so that my footer row will also show up at the very bottom of the page (unless content pushes it further down). But when the browser renders the page, its as if there was no height specified on the table, it all just shrinks up to the top of the page, as short as the content will...
2
6590
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type: text/html; charset=utf-8"
3
5743
by: PYG | last post by:
Hi everybody I have a simple question : If i use this code : <body style="font-size:24px;color:blue;"> Text in body <table> <tr><td> Text in table
1
4462
by: Gary | last post by:
Hello folks, I have a simple bug that defies my ability to find a work around. In IE7 strict-mode, if you have a table with width 100% in a DIV block.. the content will appear UNDER the div's scrollbar. If you switch to quirks-mode the problem goes away - meaning the table width adjusts to accomodate the scrollbar. To see, display the follow html and click "add text" until you get a scrollbar. Some text will appear under the scrollbar....
92
5127
by: Erwin Moller | last post by:
Hi group, I encoutered page validation error, but I don't know a way around. The page has the following doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Some hyperlinks need to open to a new window, so I used the (wrong) target="" attribute.
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8723
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
8502
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
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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
5632
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
4150
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...
1
2726
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
2
1601
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.