473,394 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Different padding different browser

Mel
try the following code in IE and Mozila and you get 2 different padding

<fieldset>
<legend>This is a test</legend>
<div style=padding:10px>hello</div>
</fieldset>

HOW CAN I AVOID THIS ?

thanks
Jul 21 '05 #1
5 3919
Mel wrote:
try the following code in IE and Mozila and you get 2 different padding

<fieldset>
<legend>This is a test</legend>
<div style=padding:10px>hello</div>
</fieldset>

HOW CAN I AVOID THIS ?


google a bit for legend and fieldset. It's a beast...
But in your example the paddings and margins of fieldset, legend and div
(and under circumstances the contents of div) will change the padding.

Chris
Jul 21 '05 #2

"Mel" <me**********@hp.com> wrote in message
news:41********@usenet01.boi.hp.com...
try the following code in IE and Mozila and you get 2 different padding

<fieldset>
<legend>This is a test</legend>
<div style=padding:10px>hello</div>
</fieldset>

HOW CAN I AVOID THIS ?


Your DIV tag has a STYLE attribute whose value is "padding:" and then
another, invalid attribute named "10px" without a value assigned to it. Use
quotes to delimit attribute values, and you won't have this problem.

Jul 21 '05 #3
On Wed, 5 Jan 2005 12:42:58 -0500, Harlan Messinger
<h.*********@comcast.net> wrote:
"Mel" <me**********@hp.com> wrote in message
news:41********@usenet01.boi.hp.com...
[snip]
<div style=padding:10px>hello</div>


[snip]
Use quotes to delimit attribute values, and you won't have this problem.


That was my first impression, too. However, attribute values don't need to
be quoted if they only contain letters, digits, hyphens, periods,
underscores and colons. As the one in question does, it *should* be OK.
I'd have thought that the problem is more likely to be different
margin/padding combinations across all of the elements involved.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #4
Michael Winter <M.******@blueyonder.co.invalid> wrote:
Harlan Messinger <h.*********@comcast.net> wrote:

Use quotes to delimit attribute values, and you won't have this
problem.


That was my first impression, too. However, attribute values don't
need to be quoted if they only contain letters, digits, hyphens,
periods, underscores and colons. As the one in question does, it
*should* be OK.


Not agreeing nor disagreeing, yet quoting attributes is still a very
good habit to develop. Might not actually fix this problem, but it's
certainly a good suggestion.
Jul 21 '05 #5

"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsj45fa06x13kvk@atlantis...
On Wed, 5 Jan 2005 12:42:58 -0500, Harlan Messinger
<h.*********@comcast.net> wrote:
"Mel" <me**********@hp.com> wrote in message
news:41********@usenet01.boi.hp.com...
[snip]
<div style=padding:10px>hello</div>


[snip]
Use quotes to delimit attribute values, and you won't have this problem.


That was my first impression, too. However, attribute values don't need to
be quoted if they only contain letters, digits, hyphens, periods,
underscores and colons. As the one in question does, it *should* be OK.


My mistake. But, to digress, the line in the spec that follows the one you
paraphrase above says, "We recommend using quotation marks even when it is
possible to eliminate them." The reason for this is ease of reading and
maintenance, and here was a case where that came into play, because as the
code appeared on my screen, I thought there was a space after the colon. If
the value were quoted, I wouldn't have looked twice because the space
wouldn't have mattered even if it were there.

Just out of curiosity, though: what if you *tried* it to see if it fixed the
problem? It may be a browser bug.
I'd have thought that the problem is more likely to be different
margin/padding combinations across all of the elements involved.


Jul 21 '05 #6

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

Similar topics

2
by: Dr. Richard E. Hawkins | last post by:
I've googled around, and asked everyone I know, but I still can't find any reference to anyone else having faced this particular IE bug with floats. I've put a page at...
1
by: Danny | last post by:
hi, lately i've been working on a website and i have used a bit of javascript although i'm not an expert in this mather. On the page there are 3 thumbnails and when you click on a thumbnail a...
11
by: muraii | last post by:
Hi all, I've trolled through Google, a little of evolt, css-discuss archives, and sent the list a request, all to no avail. I consulted positioniseverything.net and quirksmode.org. The issue I...
9
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers,...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
3
by: ashkaan57 | last post by:
Hi, I have a page that looks crooked in Firefox but displays normally in IE. http://www.legalpersian.com The page was designed using Visual Web Developer 2005 (part of MS Vsual Studio 2005...
19
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It...
8
by: rodeored | last post by:
page: http://reenie.org/test/blockpadding.htm code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>test</title> </head> <body> <h2 style='padding:0; border:solid 1px...
14
by: shyam.lingegowda | last post by:
Hi all, If I have two c++ programs and I compile that using two different compilers on Unix. Is it possible for these two exe's to communicate with one another. Since the way the exe's are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.