473,799 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE shows more space between paragraph

254 Contributor
Hi

I have written some code which works fine as I intend to work in Mozilla but not in IE. In IE it shows more space between two lines "Franchise Support" "Store Environment".

so what is wrong in this code. here is code

Expand|Select|Wrap|Line Numbers
  1.  
  2. <div id="mainNav">
  3.         <ul>
  4.             <li><a href="about.html" class="on">About Jamba</a></li>
  5.             <li><a href="support.html">Franchise Support</a></li>
  6.             <li><a href="store.html">Store Environment</a></li>
  7.             <li><a href="products.html">Jamba Products</a></li>
  8.             <li><a href="brands.html">Jamba Brands</a></li>
  9.         </ul>
  10.     </div>
  11.  
  12.  
Expand|Select|Wrap|Line Numbers
  1.  
  2. #mainNav{
  3.     width: 181px;
  4.     height: 130px;
  5.     float: left;
  6.     background:url(../images/mainNavBg.gif) left bottom no-repeat;
  7. }
  8.  
  9. #mainNav ul{
  10.     color: #572600;
  11.     list-style: none;
  12.     height:10px;
  13. }
  14. #mainNav li{
  15.     font-size: 10px;
  16.  
  17. }
  18. #mainNav ul li a{ padding-left: 30px; color: #572600; text-decoration: none;}
  19. #mainNav ul li a:hover{color: #ffffff;}
  20. #mainNav ul li a.on{color: #ffffff;}
  21.  
  22.  
May 30 '09 #1
10 4029
prabirchoudhury
162 New Member
hey..

you could use line height in #mainNav class

Expand|Select|Wrap|Line Numbers
  1.  
  2. #mainNav{
  3. width: 181px;
  4. height: 130px;
  5. float: left;
  6. /*change your height you need*/
  7. line-height: 20pt;
  8. background:url(../images/mainNavBg.gif) left bottom no-repeat;
  9. }
  10.  
  11.  
May 30 '09 #2
mukeshrasm
254 Contributor
@prabirchoudhury
Thanks! It works fine but I wanted to ask that why do I need to give line-height for IE which works for other browser as well. why don't it works without line-height as it works fine in Mozilla and Chrome.
May 30 '09 #3
drhowarddrfine
7,435 Recognized Expert Expert
@mukeshrasm
I'm too lazy to look at why this fixes it but always remember that IE is the worst browser on the planet. 11 years behind all others in modern standards and practices, it should never be trusted to do anything correctly.
May 30 '09 #4
prabirchoudhury
162 New Member
drhowarddrfine is right .. IE sucks man .. good that is fixed ... :)
May 31 '09 #5
omerbutt
638 Contributor
@mukeshrasm
some times you donot have a valid argument for such things so donot get yourself stucked into y it works like this , just make your mind that it works like this and yes IE is like :S
Jun 1 '09 #6
vacvac
6 New Member
IE is garbage, because is MICROSOFT. Do you listen music in Windows Media Player or in Winamp, same with IE and Mozilla. Even IE don't support transparent *.png, don't suport some CSS codes. IE not works with the Web strandarts
Jun 2 '09 #7
Stomme poes
14 New Member
I would assume the line-height works because IE is always paying attention to line heights and font sizes (why when you are trying to make a 0 height div, in IE there's always a bit of height unless you explicitly state font-size: 0).

IE6 used to believe line-height = height. I know IE7 doesn't have this exact bug but it might have had something similar (esp if the original bug had anything to do with Haslayout).

If IE8 did not need the fix then I would def. be leaning more towards a "Haslayout affected it" scenario. I'm not sure if I ever read anywhere where the font/line-height bug came from.
Jun 5 '09 #8
JamieHowarth0
533 Recognized Expert Contributor
A quick tip - a standard-compliant way of getting IE6 elements to render using IE6-specific styling (and yes, it is to do with some elements not correctly having hasLayout set) is to use the * html selector.
Weird, but IE6 believes that there is an "invisible" element wrapping the root HTML element in any document - so * html body div.yourelement id will only work in IE6.

line-height forces hasLayout in IE6, as does height - I can't remember the rest right now. PositionIsEvery thing has a bunch of stuff on how to get standards-compliant CSS to work in most browsers.

codegecko
Jun 6 '09 #9
Stomme poes
14 New Member
Line-height does not trigger Haslayout, though yes height does-- IE6's confusing between height and line-height apparently doesn't extend to setting Haslayout: http://www.satzansatz.de/cssd/onhavinglayout.html
Jun 7 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

21
4033
by: Christian Seberino | last post by:
Linux kernel style guide, Guido's C style guide and (I believe) old K&R style recommends 8 SPACES for indent. I finally got convinced of wisdom of 8 space indentation. Guido also likes 8 space indentation FOR C CODE. Why style guide (PEP-8) for Python says 4 space indents??? Is breaking rule to use 8 space indents everywhere
2
2247
by: Malcolm Dew-Jones | last post by:
I am looking at xslt 1.0 and trying to understand if empty text nodes are supposed to be stripped or not as the default behaviour. 3.4 starts by listing rules for when white space is not stripped and then says "Otherwise the text node is stripped". which appears to contradict a later paragraph that discusses the details of the selection of nodes to be stripped ("Initially ... preserve ... all element names").
0
1622
by: Timo | last post by:
Should e.g. a paragraph to be consired as a replaced element when it has a css-property 'white-space: pre'. I ask this because this effects the width calculations of the element. I think a <p> with 'white-space: pre' should somehow be replaced because its dimension are defined by the element itself (after the font sizes etc. has been taken in account) Timo
3
9019
by: Simon Dean | last post by:
Hello! Im looking to try and get into CSS for formatting my sites. Seems like a nice premise, and should allow easier design for the future. But gees, Im having a hard time of it. I would like to create something like at http://www.blargle.co.uk or http://www.celebrityresearcher.co.uk without the tables. I figure should be easy, to have two DIV rows, 100% width, and then have
8
6875
by: lkrubner | last post by:
Am I wrong, or do paragraphs have extra space on top in FireFox, when compared to Microsoft IE. The top of this page is an example: http://www.publicdomainsoftware.org/index.php?pageId=299 The text in the box at top looks like it has an extra 10 or 20 pixels of padding at the top, when FireFox is compared to IE. Why is that?
38
24009
by: Xah Lee | last post by:
sometimes i wish to add white space in <p> as to achived effects similar to tab. what should i do? using empty image seems the sure way but rather complicated. (and dosen't change size with font) Woudl some of the space character in unicode work? (my html files uses unicode) Xah
2
12180
by: Petr Jakes | last post by:
Hi, I am trying to set-up communication to the coin change-giver from my Linux box using the Python code. The change giver uses MDB (Multi Drop Bus) serial protocol to communicate with the master. MDB protocol is the 9bit serial protocol: (TX, RX lines only) 9600bps, 9bits, No Parity, 1 Start, 1 Stop. I would like to control the UART "parity bit" to try to simulate 9bit communication.
7
21989
by: JohnBirch | last post by:
I am new to CSS and have spent many unsuccessful hours trying to find a way to remove the space above the beginning of a paragraph. What I want to do is to have a bold heading <H3> in 12pt followed immediately on the next line by text in normal 10pt. I'm sure there is a simple answer that escapes me but how do I do it?
5
11745
by: RetroMIDI | last post by:
I notice that the <ptag does not always allow the same amount of space. Some websites have about half a line only. When I check their code, they have used just <p>. On other occasions it seems that <p> has left not just one line of space as per the current font size, but as much as 20 or 30 pixels. Can someone please explain to me how to control what <pdoes in terms of space after a paragraph using a CSS.
0
9687
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
9541
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
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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
10228
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
10027
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
7565
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
5463
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...
3
2938
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.