473,387 Members | 1,456 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,387 software developers and data experts.

IE shows more space between paragraph

254 100+
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 4008
prabirchoudhury
162 100+
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 100+
@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 Expert 4TB
@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 100+
drhowarddrfine is right .. IE sucks man .. good that is fixed ... :)
May 31 '09 #5
omerbutt
638 512MB
@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
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
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 Expert 512MB
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.yourelementid will only work in IE6.

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

codegecko
Jun 6 '09 #9
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
tpeck
1
The line-height fix doesn't seem to work on the spacing between the paragraphs. It just squashes everything (except the space we want to make equal in all browsers).

The solution that seems to work perfectly is:

p {margin: 0px 0 20px;}

..though someone else provided it, not me!
Nov 11 '10 #11

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

Similar topics

21
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...
2
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...
0
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>...
3
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...
8
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...
38
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...
2
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...
7
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...
5
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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,...

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.