473,666 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE5 ignores padding or margin for inline elements - workaround?

Hi

Does somebody know a workaround for the fact that IE5 does not apply margin
and padding to inline elements? I have a navigation with those styles:

ul#navigation {
border-top:1px #000000 solid;
border-bottom:1px #000000 solid;
list-style:none;
margin:0;
padding:0.2em 0 0.2em 2em;
white-space:nowrap;
}
ul#navigation li {
display:inline;
margin:0;
padding:0 2em 0 0;
font-weight:bold;
color:#000000;
}

Works nicely in standards browsers and IE6. Can this get fixed for IE5
without breaking other browsers, or even using deprecated HTML?

Thanks for a hint.

--
Markus
Aug 6 '05 #1
11 1893
Els
Markus Ernst wrote:
Hi
Hello
Does somebody know a workaround for the fact that IE5 does not apply margin
and padding to inline elements?
I've only had succes with applying a height to them, but even a 1px
height will result in a higher height than I usually want.
I have a navigation with those styles:

ul#navigation {
border-top:1px #000000 solid;
border-bottom:1px #000000 solid;
list-style:none;
margin:0;
padding:0.2em 0 0.2em 2em;
white-space:nowrap;
}
ul#navigation li {
display:inline;
margin:0;
padding:0 2em 0 0;
font-weight:bold;
color:#000000;
}

Works nicely in standards browsers and IE6. Can this get fixed for IE5
without breaking other browsers, or even using deprecated HTML?
I forgot if I apply the height to the <li> element, or to the <a>
element inside, really, but the trick is in the height :-)
Thanks for a hint.


You're welcome.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Dirty White Boy - Badlands
Aug 6 '05 #2
Els wrote:
Does somebody know a workaround for the fact that IE5 does not apply
margin and padding to inline elements?


I've only had succes with applying a height to them, but even a 1px
height will result in a higher height than I usually want.

I forgot if I apply the height to the <li> element, or to the <a>
element inside, really, but the trick is in the height :-)


Ouf... height is one of those dimensions that are differently computed in
IE5, isn't it? I guess before adding Tantek hacks and adjusting heights for
different kinds of rendering engines... I will rather sniff IE5 with PHP and
add some &nbsp;s then...

Thanks a lot for your input and enjoy working on saturday ;-)

--
Markus
Aug 6 '05 #3
"Markus Ernst" <derernst@NO#SP #AMgmx.ch> wrote:
Does somebody know a workaround for the fact that IE5 does not apply margin
and padding to inline elements? I have a navigation with those styles:


Unless you have an unusual high percentage of IE5.0 clients, I wouldn't
worry about it (IE5.5 does apply padding to inline elements).

--
Spartanicus
Aug 6 '05 #4
Els
Markus Ernst wrote:
Els wrote:
Does somebody know a workaround for the fact that IE5 does not apply
margin and padding to inline elements?
I've only had succes with applying a height to them, but even a 1px
height will result in a higher height than I usually want.

I forgot if I apply the height to the <li> element, or to the <a>
element inside, really, but the trick is in the height :-)


Ouf... height is one of those dimensions that are differently computed in
IE5, isn't it? I guess before adding Tantek hacks and adjusting heights for
different kinds of rendering engines... I will rather sniff IE5 with PHP and
add some &nbsp;s then...


Your choice.

But I now guess you only want to separate them horizontally? It helps
to have line-breaks in the code between the </li> and the next <li>.
Only gives a little space though, if you want more, than yes: height,
or &nbsp;.

But I take it you have something against hacks?
Thanks a lot for your input and enjoy working on saturday ;-)


I can see the wink, but I still don't get t - I'm not working atm if
that's what you think?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Chuck Berry - Maybelline
Aug 6 '05 #5
Spartanicus wrote:
"Markus Ernst" <derernst@NO#SP #AMgmx.ch> wrote:
Does somebody know a workaround for the fact that IE5 does not apply
margin and padding to inline elements? I have a navigation with
those styles:


Unless you have an unusual high percentage of IE5.0 clients, I
wouldn't worry about it (IE5.5 does apply padding to inline elements).


Oh that's good news, thank you!

--
Markus
Aug 6 '05 #6
Els wrote:

But I take it you have something against hacks?

I prefer server side hacks to client side ones, because I have more control
over the output.
Thanks a lot for your input and enjoy working on saturday ;-)


I can see the wink, but I still don't get t - I'm not working atm if
that's what you think?

Yes, wrong assumption of mine... so enjoy whatever you do!

--
Markus
Aug 6 '05 #7
Els
Markus Ernst wrote:
Els wrote:

But I take it you have something against hacks?


I prefer server side hacks to client side ones, because I have more control
over the output.


I prefer to use hacks based on what a browser is capable of, not based
on possibly wrongly sniffed UA strings.
Thanks a lot for your input and enjoy working on saturday ;-)


I can see the wink, but I still don't get t - I'm not working atm if
that's what you think?


Yes, wrong assumption of mine... so enjoy whatever you do!


Tnx ;-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Deep Purple - Speed King
Aug 6 '05 #8
On Sat, 6 Aug 2005, Markus Ernst wrote:
Els wrote:

But I take it you have something against hacks?

I prefer server side hacks to client side ones, because I have more control
over the output.


Not necessarily. Think about cache servers. Think about a saved copy
of a web page, browsed with various browsers. And so on. And the
other more-obvious problems, of course, not limited to the widespread
phenomenon of web-compatible browsers having to pretend to be MSIE
because of so many proprietary "web" pages refusing to talk to them
unless they do so.

Sending your well-"controlled " output to the wrong browser is surely
worse than doing nothing?

Aug 8 '05 #9
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote:
On Sat, 6 Aug 2005, Markus Ernst wrote:
I prefer server side hacks to client side ones, because I have
more control over the output.


Not necessarily. Think about cache servers. Think about a saved
copy of a web page, browsed with various browsers. And so on.


That's the problem, indeed. Of course *anybody* who negotiates
indicates that the outcome may vary. Nudge nudge, wink wink.
And the other more-obvious problems, of course, not limited to the
widespread phenomenon of web-compatible browsers having to pretend
to be MSIE because of so many proprietary "web" pages refusing to
talk to them unless they do so.


The UA string is particulary unreliable, but doublechecking against the
accept header server-side increases the odds to hit the right horse
remarkably for certain browsers of sorts. A request for text/html is
yet to be seen even in the OS-component-pre-releases de jour.

It's fun that even when using the inherently safer navigator object
client-side (well, if available) some people still seem to be inclined
to consult the easily spoofed userAgent instead of appName and
appVersion (fumbling with the registry apart, or local proxies that are
deliberately set up to be reasonably unreasonable :-).

But it would certainly be enlightening to figure out why it is so hard
to grasp that 'control over the output' is a matter of request instead
of response in this context (I *do* know everyday's our-cms-is-
basically-broken-and-I'm-not-authorized-to-fix-the-source-of-the-
problem situation, Tfornotbringing thatupIA :-).
--
Goodbye and keep cold
Aug 9 '05 #10

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

Similar topics

17
29233
by: delerious | last post by:
I'm trying to add some simple padding to an IMG by using a padding-right style, but it doesn't work in IE. Works fine in Mozilla and Opera, though. Here's a link to a page which displays this IE problem: http://home.comcast.net/~delerious1/index12.html I do know that I can solve the problem in IE by changing padding-right to margin-right, but then the links cannot be clicked when the mouse is over that margin area. So I would...
9
4204
by: Paul McKenna | last post by:
Hello Here is my code: <div> <span> ... Flash object... </span> <span> <img src="a.gif">
3
1757
by: fleemo17 | last post by:
The same layout I discussed earlier (http://www.sunriveronline.org/misc/clrn ) looks pretty darn good in most of the browsers I've checked it with, except for Opera. Apparently, Opera is applying my 0 Margin attribute on the background image, but keeping an 8-pixel margin for the page's elements, which throws the design into a tizzy. Is there a way to make Opera apply the 0 margin to all the elements on the page? -Fleemo
26
2517
by: meltedown | last post by:
I have 2 left floating divs on a page. Sometime the left side is larger, sometimes the right side is larger. I want the page to have a margin at the bottom of whichever div is the largest. If I put a bottom margin on one of the divs, it might not be the largest div, in which case the margin won't show up. If I put the margin on both divs, when the right floats below the left side in a small window, there is too much margin between the...
36
3021
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 get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
10
12901
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If you look at it in IE (6 or 7), you find it also looks fine, except for the top margin missing from the links across the top of the page. That's not the main issue here, but any pointers as to why it doesn't show them would be appreciated.
3
6497
by: Daz | last post by:
Hi everyone. I have just been making a JavaScript chat applet, which should open in a new child window. It does all of this fine, and works within Firefox beatifully. However, IE thinks it's necessary to stop my iFrames from spaning the entire length and width of the Window, and add about 7-8mm of padding/margin to the inside of the Window. I can't figure out, whether it's adding it to the inside of the window, or the outside of the...
19
6467
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 happens in IE6, IE7 and Firefox (didn't try any others). And when you save the page, the margin/paddings are actually REMOVED from the saved HTML file (!). Why is this?
0
1399
by: adminloozer | last post by:
Hello, I've some difficulities when using padding or margin to position an element (alone on page alongside other elements OR inside another parent element). Can I say usually I will use margin to position or create some room between parent elements and padding to position or create some room between a parent element and child elements like a header with its links bar, search div, image div... If someone can tell me when using margin...
0
8454
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
8362
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8785
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
8560
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
8644
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...
0
4200
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
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.