Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CSS quirk in IE/Firefox

Posted on 2006-07-12
5
340 Views
Last Modified: 2008-03-03
Good day,

I'm having a small problem with my css and placement of a global navbar in my site.

Please look at this page in IE & Firefox and note the different position of the globalnav bar at the top of the page, just under the header banner.  You'll note that in one it sits inside of the #mastHead div and in firefox it sits just under the #mastHead div....

http://www.hfspools.com/

Visually, it's rendered correctly in IE, however, I am certain that its exactly the reverse as is with most CSS/IE quirks I come across. I am sure FF is rendering it correctly.

Anyhow, whatever help I can get I will gladly take!

Here's the css:

#masthead{
      margin: 0;
      padding: 10px 0px 0px 0px;
      border-bottom: 1px solid #cccccc;
      width: 100%;
}

#navBar{
      background-color: #ECF0F9;
      padding: 0px;
      margin-right: 73%;
/*      margin-bottom: 0;
      margin-left: 0;
*/      border-right-width: 1px;
      border-right-style: solid;
      border-right-color: #ccc;
      border-bottom-width: 1px;
      border-bottom-style: solid;
      border-bottom-color: #CCCCCC;
}

Here's the HTML:

<div id="masthead">
<a href="../index.php"><img src="../images/masthead.gif" alt="HornerXpress Financial Service" width="475" height="99" border="0" /></a>
<div id="globalNav">
  <a href="../pool/loan-center/benefits.php">Benefits of Financing</a> | <a href="../pool/loan-center/finance.php">Pool Financing</a> |
<a href="../pool/loan-center/home-improvement.php">Home Improvement Loans</a> | <a href="../pool/app/index.php">Apply
Now</a> |
<a href="../contactus.php">Contact Us</a> |
<a href="../index.php">Home</a></div>
<div id="globalPhone">877-HFS-POOL</div>
</div>

Thank you-
0
Comment
Question by:pmagony
  • 3
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 250 total points
ID: 17093996
you need to add some clearing element after your #navBar:

<div class="clear">&nbsp;</div>

div.clear {
  height: 1px;
  margin-top: -1px;
  overflow: hidden;
}

... or you need to float your #masthead:

#masthead {
  float:left;
  background-color: #fff;
}
0
 
LVL 9

Author Comment

by:pmagony
ID: 17094220
Thanks dude! This is what worked:

<div style="clear:both;"></div>

0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17094412
yes, i forgot the main part in my "div.clear" ruleset...  ;)

div.clear {
  height: 1px;
  margin-top: -1px;
  overflow: hidden;
  clear: both;
}

note that elements should never be empty... that's the reason for the &nbsp; and the more complex ruleset.
0
 
LVL 9

Author Comment

by:pmagony
ID: 17094423
You gave me a 'B' rated answer!!!!!

Hehe, it's all good...  you helped and between the two of us we got it.

All the best-
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17094733
> You gave me a 'B' rated answer!!!!!
lol, we can see it that way.  congratulations for your answer ;).
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question