473,574 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to avoid padding around content when using "DOCTYPE .. html4/strict.dtd" ?

I have a table with a cell on the bottom right with an image to create a
rounded corner effect:

<table cellpadding="0" cellspacing="0" border="1">
<tr><td rowspan="2">asd fsadf</td>

<td align="right" valign="top">as dfsaf</td></tr>

<tr><td align="right" valign="bottom" >
<img src="images/corner.gif" width="11" height="11"></td>
</tr></table>

With the old-fashioned method as the above would work just fine, however,
as soon as I include at the top of the doc: ..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

... a vertical padding, spacing or margin is created above and below the
image or/and the text elements. Is there a way to avoid this?
Aug 13 '05 #1
4 2844
timmy wrote:
I have a table with a cell on the bottom right with an image to create a
rounded corner effect:
Don't do that.
http://www.allmyfaqs.com/faq.pl?Tableless_layouts
http://css-discuss.incutio.com/?page=RoundedCorners
With the old-fashioned method as the above would work just fine, however,
as soon as I include at the top of the doc: ..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

.. a vertical padding, spacing or margin is created above and below the
image or/and the text elements.


Inline images have, by default, a vertical alignment that causes them to sit
on the baseline. There is space below the baseline for descenders (which
you find on the letters f, g, j and p but not a, b, c or d). Adjusting the
vertical alignment of the images, or cause them to display as something
other than inline will cause the gap to vanish.

That isn't the solution in this case though, but is worth remembering for
when you have tabular data that includes images.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 13 '05 #2
timmy wrote:
I have a table with a cell on the bottom right with an image to create a
rounded corner effect:

<table cellpadding="0" cellspacing="0" border="1">
<tr><td rowspan="2">asd fsadf</td>

<td align="right" valign="top">as dfsaf</td></tr>

<tr><td align="right" valign="bottom" >
<img src="images/corner.gif" width="11" height="11"></td>
</tr></table>

With the old-fashioned method as the above would work just fine, however,
as soon as I include at the top of the doc: ..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

.. a vertical padding, spacing or margin is created above and below the
image or/and the text elements. Is there a way to avoid this?


I agree with David about the better approach. A direct answer to your
"what happened?" question is to eliminate the line break in your code
between the opening TD tag and the IMG tag. I think that will help.
Aug 14 '05 #3
On Sat, 13 Aug 2005, Harlan Messinger wrote:
A direct answer to your "what happened?" question is to eliminate
the line break in your code between the opening TD tag and the IMG
tag. I think that will help.


Plus the fact that the vertical positioning of img by default is the
font baseline (which leaves room for descenders below), so use CSS to
change the position to "bottom" instead if that's what you want.
This particularly shows up in a browser's standards mode (as opposed
to quirks mode).

Aug 14 '05 #4
Thanks for all the valuable answers!

I have another question:

Is it possible to place a <div> e.g. a navbar, at the bottom of the browser
screen, below scrollable or non-scrollable content? This happens anyway if
text or other content is causing the window to scroll.

But if there's less content than a screenfull, is there a way to push the
div down exactly to the bottom of the screen, rather than having it
floating just below the last text line? For example:

---------------------------------------
| |
| Heading |
| |
| text text text |
| text text |
| |
| |
| |
| |
| |
| |
|-----------------------------------|
| bla | blabla | bla |
-------------------------------------


Aug 14 '05 #5

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

Similar topics

14
13062
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in - ImageName - for processing, or the return data which is done (or not as the case may be) by imagejpeg($img) in the script, after header("Content-type:...
2
9394
by: Pavel | last post by:
Greetings to all - I'm having a problem processing xml with relative dtd URI specified using XSLT: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE mydoc SYSTEM "my.dtd"> <mydoc> .... </mydoc>
2
1356
by: Laurent R. Therond | last post by:
Hi, I searched for something like this, but could not locate any information. I may have used bad keywords, or it does not make any sense... Anyhow, there it goes... Let's say you overlay an XML document with markup of another namespace, how would you tell a validating parser to ignore elements
4
16252
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears to use javascript to submit the document via the browser's DOM. <form action='loginScript.cgi' method="post" name="loginForm">
4
6911
by: Tom Eldridge | last post by:
Hi all I'm getting tons of these errors when running the w3c validator on my template page. Basically it will say for example: element "TITLE" undefined. Do I need to put this into lowercase or uppercase or have I got completely the wrong end of the stick and need to define my doctype to another? Currently I have this:
50
6031
by: Shadow Lynx | last post by:
Consider this simple HTML: <!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> <title>Strict kills my widths!</title> </head> <body> <table style="width:400px; table-layout:fixed;">
9
4830
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search has shown me that this is a common problem, but I have tried to follow all the various instructions but none of them make any difference. First...
1
4963
by: Bill Faulk | last post by:
I want to avoid letting users use the back button on forms with multiple postbacks so I use Response.Cache.SetNoStore() for these pages. This works fine for IE7 and Firefox by showing the desired "this page is expired" message for those browsers. IE6 just shows a "the page cannot be displayed" error. Is there any way to avoid the error for...
2
6659
by: kilo | last post by:
Hey.. I need someone hwo can help me making my sql table.. I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with sound and text.. When I'm making the dictation with PHP I'm getting an error like this.: Query failed (SELECT word FROM repository): Table...
0
8257
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...
1
7828
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...
0
8113
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...
1
5634
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...
0
5316
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...
0
3765
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2253
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
1
1358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1076
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...

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.