/    Sign up×
Community /Pin to ProfileBookmark

cross-browser problem…pls help

Hey guys!
I’m stuck with a problem…pls take a look:

here is the css part:

[CODE]
#title {
position:relative;
margin-top:204px;
margin-left:3px;
float:left;}
#title h3 {
font-family: tahoma, arial;
font-size: 11px;
color:#FFFFFF;}
#lang {
position:relative;
margin-top:216px;
margin-left:375px;
width:60px;}
[/CODE]

and here is the html part

[code=html]
<div id=”title”>
<h3>Despre Noi</h3>
</div>
<div id=”lang”>
<img src=”img/ro.gif” />
<img src=”img/eng.gif” />
</div>
[/code]

the problem is that I get the title div closer to the top in IE than in Firefox.. while the lang div stays the same in both.

Thanks for ur time!

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJan 17.2007 — Not sure what you are seeing, but add this to your CSS:* {border:0; padding:0; margin:0;}[/QUOTE]
Copy linkTweet thisAlerts:
@byte_eaterauthorJan 17.2007 — Not sure what you are seeing, but add this to your CSS: border:0; padding:0; margin:0;[/QUOTE]

I cannot add margin:0 cause I have set the margin value needed for the elements... and padding doesn't help....unfortunately!
Copy linkTweet thisAlerts:
@d_tedJan 17.2007 — try this

i removed the left float, and make the difference 216-204 in top margin.


[CODE]<!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" xml:lang="en" lang="en">
<head>
<title>{title}</title>

<style>

#title {
position:relative;
margin-top:204px;
margin-left:3px;
}
#title h3 {
font-family: tahoma, arial;
font-size: 11px;
}
#lang {
position:relative;
margin-top:12px;

margin-left:375px;
width:60px;}
</style>

</head>
<body>


<div id="title">
<h3>Despre Noi</h3>
</div>
<div id="lang">
<img src="img/ro.gif" />
<img src="img/en.gif" />
</div>

</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@WebJoelJan 17.2007 — I cannot add margin:0 cause I have set the margin value needed for the elements... and padding doesn't help....unfortunately![/QUOTE] I think you missed the point... IE adds about 3-pixels even before [I]you[/I] add [I]your[/I] padding and/or margin. By starting IE out at "zero" border, margin and padding, you may then [I]add[/I] whatever border, margin and padding that you require. Your page will them look very similar in Firefox, Mozilla and Opera (and most all other 'compliant' browsers). If the STYLE I showed is used [B]first[/B], it will set IE to a 'default', more all-browser friendly setting, then subsequent stylings will be accepted on a now level playing field. If d_ted's code worked for you, -great (I tried it, -saw only a mild change and not sure if this is what you are after..).

View it now in IE and then view it in Firefox. If there is still a difference, then try my suggestion too. ? And as you allude, yes, you will now have to add your own padding, margin & border to every element [I]after[/I] the * {} part because we have removed the 'IE default' values from every element (that is what "*" is, = "universal selector") .. but the cross-browser results will be worth the extra effort.
Copy linkTweet thisAlerts:
@byte_eaterauthorJan 18.2007 — I think you missed the point... IE adds about 3-pixels even before [I]you[/I] add [I]your[/I] padding and/or margin...[/QUOTE]


Thanks a lot,man!!! I tried your example when u first posted, but I added at the end of the properties, and it didn't change.. but now it's working great! Thanks once again...u solved for me not only this problem, but I was always getting this 3px difference...and I was going mad?

P.S.: I hate explorer so much...it's always giving me head ache...why the F### all other browsers display correctly, and NO only explorer must show such tricks....?
×

Success!

Help @byte_eater spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...