website style fine in IE but goes mental when in firefox

Soldato
Joined
27 Mar 2003
Posts
2,710
Well I am still fairly new to web stuff (i have about 4 months experience).

But I am now moving away from table based design to DIV based design and have got to grips with CSS (probably not the level of some of you lot but enough to understand how to get my site working).

the problem I have is that I have used IE 7 as my test browser and everything looks fine but when I used firefox all the object go all over the place.

Now is there a way that I can correct these issues.

now i'm not sure if I can post a link to the site as it will be used for business (not competitor but don't want to run the risk of breaking the rules).

the site is designed to allow delegates to book/ reserve a hotel place for an event



here is an example of my code.

master page:
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="AllocationsOnline.master.cs" Inherits="AllocationsOnline.AllocationsOnline" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

    <head id="MainHeader"  runat="server" >
        <title>Zibrant Allocations Website</title>
        <link href="BaseStyle.css" type="text/css" rel="stylesheet"/>
    </head>
    <body id="MainBody" runat="server">
        <div id="MainContainer">
            <form id="MainForm" runat="server">
                <div id="Header" class="Header">
                    <a href="http://www.zibrant.co.uk">
                        <img src="http://preview.ibr.co.uk/allocationsonline/animage.jpg"alt="" />
                    </a> 
                </div>
    
                <div id="MainContent">
                    <asp:ContentPlaceHolder ID="MainContentPlaceHolder" runat="server">
                    </asp:ContentPlaceHolder>
                </div>
            </form>
            <div id="MainFooter" class="Footer">
            </div>
        </div>
        
</body>
</html>

default.aspx
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AllocationsOnline.Default" MasterPageFile="~/AllocationsOnline.Master" %>

<asp:Content ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

<div id="MainContainer2" >
    <h3>
    Welcome to the Online Allocations System Please enter your event ID and authorisation code below
    </h3>
    <div id="LoginTable" class="LoginTable">
        <div id="loginLs" class="LoginTableLeft">
            <div id = "lbl1" class="LoginBlock">
                <asp:Label ID="lblEventID" Text="Event ID" runat="server"/>
            </div>
            <div id = "lbl2" class="LoginBlock">
                <asp:Label ID="lblAuthCode" Text="Auth Code" runat="server" />
            </div>
        </div>
        <div id="loginRs" class="LoginTableRight">
            <div id = "tbx1" class="LoginBlock">
                <asp:TextBox ID="tbxEventID" runat="server" />
            </div>
            <div id = "tbx2" class="LoginBlock">
                <asp:TextBox ID="tbxAuthCode" runat="server" />
            </div>
            <div id = "btnSub" class="LoginBlock">
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
        </div>
        </div>
        
    </div>
</div>




</asp:Content>

css used:
Code:
.Header
{
	width:800px;
	border-bottom:solid 1px blue;
	float:left;
	margin:0px auto;
	text-align:left;
}

.Footer
{
	width:800px;
	border-top:solid 1px blue;
	float:left;
	margin:0px auto;
	text-align:left;
}
html
{
	text-align:center;
}


img
{
	border-width:0px;
}
#MainBody
{
	width:802px;
	margin:0px;
	text-align:left;
	padding:15px;
	border:1px dashed #333;
}

#MainContainer
{
	width:801px;
	margin:0px ;
	text-align:left;
	
	background-color:#eee;
}
#MainContainer2
{
	width:801px;
	margin:0px ;
	text-align:left;
	
	background-color:#eee;
}

h3
{
	text-align:center;
	background-color:Gray;
	color:White;
	overflow:hidden;
	
	
}
h4
{
	background-color:Gray;
	color:White;
}

.LoginTable
{
	text-align:left;
	border-width:0px;
	width:800px;
}

.LoginTableLeft
{
	float:left;
	text-align:right;
	width:400px;
	
}
.LoginTableRight
{
	float:right;
	text-align:left;
	width:399px;
	
}

.LoginBlock
{
	height:30px;
}

.HotelInfo
{
	width:800px;
	border-color:Black;
	border-style:solid;
	border-width:1px;
	padding: 0px 0px 0px 0px;
	margin: 0px 0px 0px 0px;
}

.HotelInfo th
{
	width:100px;
	text-align:center;
	border-color:Black;
	border-style:groove;
	border-width:1px;
	padding: 0px 0px 0px 0px;
	margin: 0px 0px 0px 0px;
}

.HotelInfo td
{
	width:100px;
	text-align:left;
	border-color:Black;
	border-style:groove;
	border-width:1px;
	padding: 0px 0px 0px 0px;
	margin: 0px 0px 0px 0px;
}


.bottombuttons
{
	margin-left:250px;
	width:297px;
	background-color:navy; 
	height: 40px; 
	color: white;
	text-align:center; 
	float:none; 
	margin-top: 50px;
	
}

/*Page specific styles */

.GuaranteeSectionBreak
{
	width:800px;
}

.GuaranteeLeftColumn
{
	float:left;
	width:400px; 
	text-align:right;
}
.GuaranteeRightColumn
{
	float:right;
	width:399px; 
	text-align:left;
}

.GuaranteeItemBlock
{
	height:30px;
}
.GuaranteeItemBlockDble
{
	height:52px;
}




  /*css for Summary.aspx */

.SummaryTable
{
	width:800px;
	background-color:#eee;
}

.SummaryItemBlock
{
	height:30px;
	background-color:#eee;
}

.SummaryItemLeft
{
	width:400px;
	float:left;
	background-color:#eee;
	
	
	
	
}
.SummaryItemRight
{
	width:399px;
	float:right;
	background-color:#eee;
	
}

.PersonalSectionBreak
{
	width:800px;
	background-color:#eee;
}

.NextButton
{
	margin-left:-20px;
	margin-top:8px; 
	top:8px;
}

please feel free to advise on any improvements/things I am doing wrong.
If it is fine to post a link I can provide a test event for you to see how the site should work.
 
i find it best to design the site for ff and then add to the code fixing the design to work for ie, which is done by adding an underscore before the code for ie6 and iirc hash for ie7

e.g

margin: 7px; - ff
_margin: 4px; - ie
 
Imo it is better to keep all IE hacks and modifications centralised in another style sheet and add it after the main stylesheet using a conditional statement.
 
Imo it is better to keep all IE hacks and modifications centralised in another style sheet and add it after the main stylesheet using a conditional statement.

was goign to say this is also an option which people often prefer but was on phone so only typing with 1 hand and the text box is screwing up for me in ff so didn't bother as i knew someone would mention it, however maybe it would be a good idea if you said how it is done so the op can try it out
 
well the intention is that this site will have a base style and then we can use different style sheets based on client requirements.

In addition to trying to make this as secure (prevent sql injection and all the rest) as possible for the PCI compliance it really is pushing my novice skills to their limit.

So could someone tell me why the two browsers seem to treat the css differently?

plus any good resources on this both web and book based.

from the short time that I have been programming as a career I have learnt a lot and am really enjoying the different challenges that I come up against each day.

edit. I have been developing this against the xhtml traditional 1.0 profile is that the corret profile to use when testing/ validating my code.
I am using vs2005 to develop this site.
 
Last edited:
have a quick google wll provide a good read for why browsers treat css differently. afaik ie6 is the worst, and it is not ff that is doing it wrong, well doing it as wrong.

cross browser imo is the worst thing about desinging a website, i wish i could just code away when making a site but it gets really annoying getting a site to dsplay correctly in all browsers, espcially when first learning the language.
 
So could someone tell me why the two browsers seem to treat the css differently?
They have different rendering engines - Firefox uses one called Gecko and IE7 uses Trident. Gecko almost always follows the standards more closely than Trident, and thus why it's better to write for Firefox in the first place and then adjust for 'broken' rendering engines like Trident.

Write for the most standards-adhering browsers you can from the beginning (Firefox, Opera or Safari will do), and then work your way down to fixing any bugs in the IEs.

As Eriedor suggested, you can target IE browsers with separate stylesheets, using conditional comments: http://www.quirksmode.org/css/condcom.html

However, badly written markup and css can account for many problems, just as much as badly written browsers can! Make sure your markup and CSS is clean and valid (I know that's pretty difficult with .NET, but still possible).

edit. I have been developing this against the xhtml traditional 1.0 profile is that the corret profile to use when testing/ validating my code.
I am using vs2005 to develop this site.
Yes, Transitional will be fine - it won't introduce any unexpected problems.

As to your original post:

Remove the float: left from .Header and .Footer. Can't see why you would need to float either elements.

Add a clear: both; property to .Footer.

Yep, post a proper link with test up - would be more helpful.
 
i find it best to design the site for ff and then add to the code fixing the design to work for ie

I would have to disagree there. IE, between the two versions, has >80% of the browser market share so i design for IE first then check it out in FF because there is no point in basing your design and testing arround something that only 15% of the viewers of your site will use.
 
dont see why you do ie first just because it has a bigger market share as surely you do still design for ff so the market share of the browser should be regardless. its just about which is easier route, designing for ie first of ff, and as ff follows the standards much more closely this is the better option.
 
Standards mean nothing when they are not supported by the product with the biggest market share. I find it an extremely arrogant attitude to ignore IE simply because it's not standards compliant.

You have to design for your market and if your market is the general public then you have to target FF and then think of IE as an after thought is just a bad idea.
 
We're not saying ignore IE at all! We're just saying it's far more logical to kill 3 birds with one stone designing for the 3 browsers which are most standards compliant and then adding in the additional code to fix your site for IE.

The resulting webpage is the same in all browsers so you aren't neglecting any users, it's just the design process is different.
 
here is the site:

www.online.zibrant.co.uk/allocationsonline


(this can be removed should it break any rules)


if you use the following eventID and auth code this will get you into the site.

eventID = 5073
auth code = OYYHANOAEW

this is going to a test database so all information is for testing purposes.


Well this site will be used within business and I am guessing the majority of them will be using IE as their browser of choice so I could release it as it and then tweak the design at a later stage to get it more standards complianant to work with FF and other browsers.

Currently it is in its bare bones form so that I could get the feel right before it goes live.
 
Last edited:
We're not saying ignore IE at all! We're just saying it's far more logical to kill 3 birds with one stone designing for the 3 browsers which are most standards compliant and then adding in the additional code to fix your site for IE.

The resulting webpage is the same in all browsers so you aren't neglecting any users, it's just the design process is different.

The point I'm trying to make is that FF shouldn't be the first consideration when designing. Yes web standards are good and maybe one day they will make a difference. However, when the market leader (like it or not) doesn't support them, they should be taken with a pinch of salt.

If you run an e-commerce site then 80+% of your visitors are using IE and the chances of them even caring about web standards is extremely slim. So IMO it is wrong of web designers/developers to target FF first and the patch for IE. The term in development terms is Dog Fooding
 
The point I'm trying to make is that FF shouldn't be the first consideration when designing. Yes web standards are good and maybe one day they will make a difference. However, when the market leader (like it or not) doesn't support them, they should be taken with a pinch of salt.

If you run an e-commerce site then 80+% of your visitors are using IE and the chances of them even caring about web standards is extremely slim. So IMO it is wrong of web designers/developers to target FF first and the patch for IE. The term in development terms is Dog Fooding

Where are you getting 80+%?

From numbers I've seen, IE6 users (the browser of concern, i consider IE7 for all intense and purposes standards compliant) account for around 1/3 of web users and falling.
 
The point I'm trying to make is that FF shouldn't be the first consideration when designing. Yes web standards are good and maybe one day they will make a difference. However, when the market leader (like it or not) doesn't support them, they should be taken with a pinch of salt.

If you run an e-commerce site then 80+% of your visitors are using IE and the chances of them even caring about web standards is extremely slim. So IMO it is wrong of web designers/developers to target FF first and the patch for IE. The term in development terms is Dog Fooding

so when you make a website it looks differnt in ff to ie?
 
so when you make a website it looks differnt in ff to ie?

Was thinking the same.

Much easier to develop in FF and then add the IE hacks so resulting site looks the same in all browsers.

If you're saying that you design in IE6 and dont/cant fix it in for FF then your resulting code is not going to be future proof.
 
Where are you getting 80+%?

From numbers I've seen, IE6 users (the browser of concern, i consider IE7 for all intense and purposes standards compliant) account for around 1/3 of web users and falling.

IE7 is not standards compliant. That's why there is the conditional comments.

My sites don't look any different in FF but i would rather create it working in IE6 & 7 then look at it FF. IE is the mahority browser
 
My sites don't look any different in FF but i would rather create it working in IE6 & 7 then look at it FF. IE is the mahority browser

again like has been said, as the sites will end looking the same, the most used browser has nothing to do which browser to design for first, and as it is much easier to develop in FF and then add the IE hacks this is the smarter thing to do.

I find it an extremely arrogant attitude to design IE simply because it has the highest user base as userbase is completely irrelavent because your not just making one design, where as it's easier to design for browers which are standards compliant and then add hacks.
 
IE7 is not standards compliant. That's why there is the conditional comments.

Oh please there is no browser that is 100% compliant! Any browser that supports more than 95% of the w3c specifications we might aswell say are compliant, hence me stating "for all intents and purposes".

You are simply just being pedantic now!

Face it your design method is flawed, you actually say you design for IE6 and 7 and FF as an after thought when IE7 and FF are far more alike in their rendering than IE6 and 7!
 
Back
Top Bottom