Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Firefox div spacing problem
Old 01-21-2008, 04:07 PM Firefox div spacing problem
Junior Talker

Posts: 3
Trades: 0
http://www.math.vt.edu/activities/ma...est/people.php

Something weird is happening in firefox. First off, the name, title, and email address is appearing over another div tag, the mc_header (which I thought shouldn't happen). Then the mc_footer is being displayed inside the mc_body. All of this displays properly in IE7 however. I can't seem to figure out what's going on.

HTML:

Code:
<div id="mc_header">
      <div id="mc_banner"></div>
      <div class="mc_headerlink"><a id="mc_home" href="index.php">Home</a></div>
      <div class="mc_headerlink"><a id="mc_photos" href="photos.php">Photos</a></div>
      <div class="mc_headerlink"><a id="mc_files" href="files.php">Files</a></div>
      <div class="mc_headerlink"><a id="mc_people" href="people.php">People</a></div>
    </div>
    <div id="mc_body">
<div class="mc_peoplename">Dr. Brown</div>
<div class="mc_peopletitle">Faculty Advisor</div>
<div class="mc_peopleemail">brown@math.vt.edu</div>
<img class="mc_peopleportrait" src="http://www.webmaster-talk.com/images/DrBrown.jpg">
<div class="mc_peoplebio">(bio removed)</div>
    </div>
    <div id="mc_footer">
      <a id="mc_empo" href="http://www.emporium.vt.edu/"><img src="../images/link_me.jpg"></a>
      <a id="mc_vt" href="http://www.vt.edu"><img src="../images/link_vt.jpg"></a>
      <div id="mc_designers">Site designed by: </div>
      <span class="mc_designers">Ricky Shadach</span>
    </div>

  </div>
CSS:

Code:
#mc_header {
  width: 100%;
  /*display: block;*/
  margin-bottom: 30px;
}

#mc_footer {
  text-align: center;
}


#mc_banner {
  background: url('../images/logo.jpg') no-repeat;
    border: 1px solid black;
    width: 400px;
    height: 189px;
    margin: 0px 10px 5px 0px;
    float: left;
}

hr {
  float: left;
  width: 100%
}

#mc_body {
  width: 100%;
}

.mc_headerlink {
  float: left;
  margin: 11px 10px;
  padding: 2px 2px;
  font-size: 14px;
  color: #233f5f;
  width: 100px;
  /*font-weight: 600;*/
  border: 1px solid gray;
  text-align: center;
}

.mc_headerlink:hover {
  background: #dfeeff;
  cursor: pointer;
  color: #039;
    text-decoration: none;
}

#mc_header a:hover {
    text-decoration: none;
}

#mc_footer img {
  border: 1px solid black;
  padding: 0px;
  margin: 10px 10px 10px 10px;
}

.mc_eventtitle {
  font-size: large;
}

.mc_peoplename {
  padding: 0px;
  margin: 0px;
}

.mc_peopletitle {
  padding: 0px;
  margin: 0px;
}

.mc_peopleportrait {
  float: left;
}

.mc_peoplebio {
  float: left;
  margin: 10px;
}

Last edited by rshadarack; 01-21-2008 at 04:11 PM..
rshadarack is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-21-2008, 04:58 PM Re: Firefox div spacing problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You need to clear some of the floats to restore the document flow

http://www.webmaster-talk.com/css-fo...-when-set.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-21-2008, 05:31 PM Re: Firefox div spacing problem
Junior Talker

Posts: 3
Trades: 0
Thanks chrishirst. I truly appreciate the help. Unfortunately, much like the person in the thread you linked to, I don't understand what you are trying to say.

Looking back over it, I notice now that content (what the main cell is wrapped in) has float set to left. At first I thought this is what you were referring to. So I wrapped everything contained in content in a mc_content and set float to none. However, this did not change a thing in either browser.

So I went back over the rest of the float settings, and I noticed that I shouldn't have to set mc_headerlink to float: left. At least, I don't think I do. The banner (big orange picture) is set to float left, and the links should appear to the right of it, flowing around the banner. However, this only happens in IE. In firefox, the header links still appear below the banner, as if there isn't enough room to fit them (which there is).

It seems I have a fundamental misunderstanding of floats, but I've read many different articles on them. There has to be something I'm missing though. Any thoughts?

Current code:

Code:
<div id="content">
    <div id="mc_content">
      <div id="mc_header">
        <div id="mc_banner"></div>
        <div class="mc_headerlink"><a id="mc_home" href="index.php">Home</a></div>
        <div class="mc_headerlink"><a id="mc_photos" href="photos.php">Photos</a></div>
        <div class="mc_headerlink"><a id="mc_files" href="files.php">Files</a></div>
        <div class="mc_headerlink"><a id="mc_people" href="people.php">People</a></div>
      </div>
      <div id="mc_body">
<div class="mc_peoplename">Dr. Brown</div>
<div class="mc_peopletitle">Faculty Advisor</div>
<div class="mc_peopleemail">brown@math.vt.edu</div>
<img class="mc_peopleportrait" src="http://www.webmaster-talk.com/images/DrBrown.jpg">
<div class="mc_peoplebio">(bio removed)</div>
      </div> <!--MC_BODY-->
      <div id="mc_footer">
        <a id="mc_empo" href="http://www.emporium.vt.edu/"><img src="../images/link_me.jpg"></a>
        <a id="mc_vt" href="http://www.vt.edu"><img src="../images/link_vt.jpg"></a>
        <div id="mc_designers">Site designed by: </div>
        <span class="mc_designers">Ricky Shadach</span>
      </div> <!--MC_FOOTER-->     </div> <!--MC_CONTENT-->
  </div> <!--CONTENT-->
Code:
#mc_content {
  float: none;
  width: 100%;
}

#mc_header {
  width: 100%;
  margin-bottom: 30px;
}

#mc_footer {
  text-align: center;
}

#mc_banner {
  background: url('../images/logo.jpg') no-repeat;
    border: 1px solid black;
    width: 400px;
    height: 189px;
    margin: 0px 10px 5px 0px;
    float: left;
}

#mc_body {
  width: 100%;
  float: none;
}

.mc_headerlink {
  /*float: left;*/
  margin: 11px 10px;
  padding: 2px 2px;
  font-size: 14px;
  color: #233f5f;
  width: 100px;
  /*font-weight: 600;*/
  border: 1px solid gray;
  text-align: center;
}

.mc_headerlink:hover {
  background: #dfeeff;
  cursor: pointer;
  color: #039;
    text-decoration: none;
}

#mc_header a:hover {
    text-decoration: none;
}

#mc_footer img {
  border: 1px solid black;
  padding: 0px;
  margin: 10px 10px 10px 10px;
}

.mc_eventtitle {
  font-size: large;
}

.mc_peoplename {
  padding: 0px;
  margin: 0px;
}

.mc_peopletitle {
  padding: 0px;
  margin: 0px;
}

.mc_peopleportrait {
  float: left;
}

.mc_peoplebio {
  float: left;
  margin: 10px;
}

Last edited by rshadarack; 01-21-2008 at 05:34 PM..
rshadarack is offline
Reply With Quote
View Public Profile
 
Old 01-21-2008, 05:51 PM Re: Firefox div spacing problem
Junior Talker

Posts: 3
Trades: 0
I think I see what's going on. Firefox is treating the banner image as if it isn't even there when placing the other elements, while IE acknowledges it's presence. I have no idea how to fix this though.

Last edited by rshadarack; 01-21-2008 at 05:59 PM..
rshadarack is offline
Reply With Quote
View Public Profile
 
Old 01-22-2008, 04:19 AM Re: Firefox div spacing problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
that's where the clear comes into play

after the banner element in the source code add :-
HTML Code:
<br style="clear:right">
This will "break" the float of the "banner" element and make the floated elements that are following start another floated element group in the document.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Firefox div spacing problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15203 seconds with 12 queries