/    Sign up×
Community /Pin to ProfileBookmark

Doctype CSS and Firefox

It seems like the doctype below is affecting some of my cell spacing in me tables within firefox.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0//EN” “http://www.w3.org/TR/REC-html40/loose.dtd“>

When I remove it corrects the issue.

My problem is I am not allow to touch this with my organization. Is there some CSS that will fix this? I tryed to 2 lines below but they did not do anything.

*{padding:0; margin:0;}
td{padding:0; margin:0;}

Thanks for the help.

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 02.2008 — Try table {border-collapse:collapse;}
Copy linkTweet thisAlerts:
@kpikulauthorJul 02.2008 — No luck. The cell is still has a bit more spacing then it should. After I put this in table {border-collapse:collapse;}. I removed the doctype with that code in there and the extra padding went away
Copy linkTweet thisAlerts:
@kpikulauthorJul 02.2008 — What actually may be throwing this off is there is also an image that is in the same row as the problem cell. IS there something I need to do to the image? I tryed the vspace and hspace=0 but that didn't do anything.
Copy linkTweet thisAlerts:
@FangJul 02.2008 — img {vertical-align:bottom;}A lot of guesswork here, a link would be useful.
Copy linkTweet thisAlerts:
@Declan1991Jul 02.2008 — I didn't know it would make a difference, but the correct DOCTYPE is &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
Copy linkTweet thisAlerts:
@drhowarddrfineJul 04.2008 — Doctypes don't "affect" anything. Doctypes are the set of rules you tell the browser you are following when you created the page. That's why the doctype is the very first thing you put on every page before you do anything else. If you are adding/changing the doctype afterwards, then you are changing the rules and that is your problem.
Copy linkTweet thisAlerts:
@WebJoelJul 04.2008 — *{padding:0; margin:0;}

td{padding:0; margin:0;}
[/QUOTE]
There needs to be a "whitespace" between the universal selector and the declarations (should be " [B]* {padding:0; margin:0;}[/B] " (note a white-space after the "*") and then, it works and also, you no longer need the "td{padding:0; margin:0;}" (hence "universal selector" as it selects everything)
×

Success!

Help @kpikul spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...