Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV Problem with FireFox and IE

Status
Not open for further replies.

altendew

Programmer
Mar 29, 2005
154
US
Hi I am currently having a problem DIV layers

Say I have this set for my body in CSS
Code:
Body{
border-width:30px;
border-color:000033;
border-style:solid;
}
So that is going to set a thick border around my page...

The problem is when do a <div> layer like this..
Code:
<div style="top:0px">Hey</div>
In IE the word "Hey" is placed below the border as it should be, but in Firefox/Netscape its placed over the border.

Is there a fix to this?
 
So... specificy a doctype and validate your code against it. Then (assuming you are not in quirks mode for IE) you should have consistent appearance across browsers.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
i added

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Looks the same in both browsers?
 
take out the / at the end.. it added it in for some reason.
 
I see no doctype in that page. Add the doctype (read up on it) and then validate your page (and ensure that IE is not in quirks mode).

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
hmm im not allowed to add stuff to the top so i added the doctype somewhere in there :-(
 
To return to your original question, I would not use top: in the first place. There's better way to do whatever it is you're trying to do.

Doctype that is "somewhere in there" serves no purpose and can be removed.
 
well then what can i use.. im inserting this in the Music sections and thats the only way i can do it..
 
First, you never told us what exactly you want to do. And second, the code you're talking about does not even appear on the site. At least I can't find it.
 
Sorry here's the code

Code:
<div style="position:absolute; top:0px; width:700px; right:0px; align:center; height:150px; overflow:hidden; background-color:000000; z-index:+10007"></div><div style="position:absolute; top:0px; width:700px; left:0px; align:center; height:150px; overflow:hidden; background-color:000000; z-index:+10008"></div><div style="position:absolute; top:0px; width:770px; align:center; height:150px; overflow:hidden; background-color:000000; z-index:+10009" align="left"><p align="center"><embed allowScriptAccess="never"src="[URL unfurl="true"]http://shiftcode.com/flash/test.swf?bgcolor=000000&text1=im+not+that+crazy&textColor1=00FF00&text2=wacko%3F+idiotic%3F+strange%3F+weird%3F&textColor2=0000FF"[/URL] style="width:770px;height=140px"></embed></p></div>

In firefox the layers go over the page border, in IE it goes under the page borders.
 
Why not get the owner of the website to assist you in this? They will have a clear understanding of their CSS and be able to guide you on the "approved method" of adding your code to the page so that you get consistency across both browsers.

I'm guessing they may even have some pre-existing classes already set up to help do the kind of layout you want.

Just a suggestion.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top