Current location: Hot Scripts Forums » General Web Coding » CSS » Firefox driving me up the wall


Firefox driving me up the wall

Reply
  #1 (permalink)  
Old 12-18-05, 12:31 PM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
Firefox driving me up the wall

Firefox is starting to drive me up the wall; everybody says there are problems with IE and firefox is better but everything I try works ( mostly ) first time in IE and I spend hours and hours trying to get it to work in Firefox !

I have a little problem and have spent about 4hrs today and a couple of hours yesterday trying to sort it out and was hoping someone could help.

I want a very simple page with the contents centred on the screen.

I want a header 100% of the content area wide.
Below that I want the navigation buttons 100% of the content area wide
And finally the content itself 100% wide.

I have tried all 3 items as separate <div> with a width and auto margins and lastly I have created a "container" <div> with a width and auto margins. As I say IE basically works using both methods but the problems I am having with Firefox is that either is over 100% of the page wide, the content <div> is aligned to the left and the text etc. that should be in the <div> is off to the right outside the <div> etc. etc.

I have also tried putting the navigation <div> inside the header <div>.

It would be great if somebody could put me out my misery !

Anthony

Links to two of the pages I have tried :

Layout 1
Layout 2

PHP Code:

body {

    
height100%;
    
width100%;
    
margin0px;
    
font-familyVerdanaArialHelveticasans-serif;
    
font-size12px;
    
color#000000;
    
text-aligncenter;
        
background-colorsilver
}

#container {

   
margin-leftauto
margin-rightauto;
   
width700px ;
   
margin0px
   
padding0px
   
text-aligncenter
    
margin-top12px 
}

#header { 
    
margin-rightauto
        
margin-leftauto
        
width700px ;  
background-colorwhite;         
       
colorblack
    
font-familyArial;
          
padding0px
           
margin-top0px;            
           
height150px
    
margin-bottom0px 
}

#navcontainer ul{
          
padding-left0;
          
margin-left0;
          
background-color#036;
          
colorWhite;
          
floatleft;
          
width100%;
          
font-familyarialhelveticasans-serif;
}

#navcontainer ul li { display: inline; }

#navcontainer ul li a{
          
padding0.2em 1em;
          
background-color#036;
          
colorWhite;
          
text-decorationnone;
          
floatleft;
          
border-right1px solid #fff;
}

#navcontainer ul li a:hover{
          
background-color#369;
          
color#fff;
}

#navcontainer a:active
{
background-color#369;
color#fff;
}

#navcontainer li#active a
{
background-color#369;
border-right1px solid #fff;
color#fff;
}

#content {
margin0px;
    
background-colorgray;     
    
colorblack
    
font-familyArial;     
    
border-colorblack;
    
border1px solid;  
    
padding10px
    
text-alignleft 
 
}

#header .logo { 
    
floatleft
    
margin-left1.5em
    
margin-top1.0em
    
margin-bottom1.0em;
}

#header .name{
     
floatright
        
font-familyArial
        
font-size25px
        
margin-right3.0em
        
margin-top1.0em
        
background-colortransparent
        
text-alignleft

Reply With Quote
  #2 (permalink)  
Old 12-18-05, 03:29 PM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
Right I am getting somewhere now after about another 4 hours spent on this problem.

I have downloaded a similar template to what I want and was transfering my css over to its css file and my content over to its html page and everything worked Ok until I transfered over the table I was using to display the contact details and form. This is where it all went wrong; I take my information out of the table and all is OK but putting it back in and the table contents shoot off the right hand side of the screen !

So more testing and I need to find a nice way to display the table data without a table.

Anthony
Reply With Quote
  #3 (permalink)  
Old 12-21-05, 03:48 PM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
The problem was a wrongly declared margin or something !

Anthony
Reply With Quote
  #4 (permalink)  
Old 12-28-05, 09:18 AM
wheezy360's Avatar
wheezy360 wheezy360 is offline
Newbie Coder
 
Join Date: Nov 2003
Location: Toronto, ON
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry I couldn't get around to help earlier, but you were right with the incorrectly declared margins. I just wanted to add the answer for folks who may do a search on the same sort of problem.

CSS parsers read top-down, and the last declaration of a property takes precedence by default. So, in your #container css definitions, you set the left and right margins to "auto", but then you say "margin: 0px;" which basically nullifies the auto margin lines you declared above. A quick fix to that is to handle it in one line (and in a short hand at that):
Code:
margin: 0 auto;
0 - applies to the Top and Bottom margins.
auto - applies to the left and right margins.
__________________
mike-robinson.ca
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox Addon - Taken Search soapbath General Advertisements 1 03-19-06 10:33 PM
Mozilla released FireFox 1.5 ashish The Lounge 9 01-18-06 09:58 PM
Dreamweaver and Mozilla Firefox goofy New Members & Introductions 2 08-23-05 02:58 AM
onChange with 2 values not working in FireFox dooby JavaScript 2 07-09-05 12:05 PM
IE and Firefox not working together stuboo CSS 2 11-29-04 02:49 AM


All times are GMT -5. The time now is 01:46 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.