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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep propossions in ie and firefox

Status
Not open for further replies.

kruxty

Programmer
Jul 17, 2001
197
PT
Hi,

i had built a site with some forms and text box and many other stuff...
This site was made in dreamweaver and tested with IE.
In IE the site is nice but i'd installed firefox and the boxes aren't exactly where i put them... making the site a little lame!

What is the easies way to correct this?!
 
Putting a correct, valid and complete doctype at the top should be the first choice. That will usually make the design in IE as crappy looking as FireFox, because it will make them both render the page correctly. And you can work from there. Here's a list of valid doctypes:
Valid Doctypes
 
This is new stuff for me...
Wich one should i use? I'm doing my site in Asp!
 
ASP, PHP, Coldfusion, none of that matters. All those are server-side technologies that produce html code. I personally use XHTML 1.0 Strict which is the strictest. The easiest (allows for most freedom with tags) and still acceptable should be HTML4.01 Transitional. It depends on what you are producing. Do you have:
1. All tags and attributes in lower case?
2. All empty tags (like <img>, <br>, <hr>) closed?
3. All styling done with CSS?

If you answered all three questions with yes, go for XHTML. If not, resort to HTML.
 
Do i have to put all the three syntaxes?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "[URL unfurl="true"]http://www.w3.org/TR/html4/frameset.dtd">[/URL]

i should change the url to my site, right?
 
No, you choose one of them. First one is the most strict (allows least freedom with coding), second is less strict and third one is used with pages that use frames. You do not change the URI, that points to the declaration of all your html elements and attributes and tells the browser how to display them.
 
I'd tryied all the first two and they don't correct my problem.

The real problem is that i have a layer, and inside that exists a button and text field.
In IE all stays good, but in Firefox the layer is shorter... and the button and text field stay out of the layer...

How can i solve this?
 
Here's the thing. There's 99% possibility that FF is showing your page as it should look according to the coding, while IE is messing up because it is following its own set of rules that let you get away with bad coding. If you put a complete doctype at the top of the html document, that will correct IE's behaviour somewhat. Alas, not entirely. If you experience the same problem with or without the doctype, keep the doctype and show us the code. We cannot know what you're doing wrong without knowing what exactly you are doing.
 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<title>Hooo Yeee</title>
<style type="text/css">
<!--
body {
	background-color: #006699;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>

<div id="LrBanner" style="position:absolute; left:8px; top:6px; width:1035px; height:88px; z-index:1; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">
  <div align="center"></div>
</div>
<div id="LrProcura" style="position:absolute; left:8px; top:104px; width:225px; height:28px; z-index:2; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">
  <form name="frmProcura" method="post" action="maincomprocura.asp">
     <div align="right">
      <br>
      <input type="text" name="txtProcura">      
      <input type="submit" name="Submit" value="Procurar">
     </div>
  </form>
</div>

<div id="LrTitle" style="position:absolute; left:244px; top:103px; width:798px; height:25px; z-index:6; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">

<%
Dim adoConLogin
Dim strSQLLogin
Dim rsProcuraLogin

Set adoConLogin = Server.CreateObject("ADODB.Connection")
adoConLogin.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("dbs\users.mdb")
strSQLLogin = "SELECT top 1 User FROM Logins ORDER BY User ASC" 

Set rsProcuraLogin = Server.CreateObject("ADODB.Recordset")
rsProcuraLogin.Open strSQLLogin, adoConLogin

BoasVindas(rsProcuraLogin("User"))

rsProcuraLogin.Close
adoconLogin.close
set rsProcuraLogin = Nothing
set adoConLogin = Nothing
%> 
[Novos]</div>

<%
Dim adoConTop
Dim strSQLTop
Dim rsProcuraDVDTop
Dim ContadorTop

ContadorTop = 0

Set adoConTop = Server.CreateObject("ADODB.Connection")
adoConTop.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("dbs\dvdsempelicas.mdb")
strSQLTop = "SELECT top 10 Lista.Portugues, Lista.Chave FROM Lista ORDER BY Lista.Top DESC" 

Set rsProcuraDVDTop = Server.CreateObject("ADODB.Recordset")
rsProcuraDVDTop.Open strSQLTop, adoConTop
%>

<div id="LrTop" style="position:absolute; left:8px; top:176px; width:225px; height:200px; z-index:3; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">
  <div align="center">
    <p><strong>.: Top 10 :</strong>.<br>
    
	<%
	Do While (not rsProcuraDVDTop.EOF) and (ContadorTop < 10)
		response.Write("<br>")
		response.Write("<a href='mostrafilme.asp?Num=" & rsProcuraDVDTop("Chave") & "' target='_blank'; style='text-decoration:none; color:#000000; font-size: x-small;'>" & rsProcuraDVDTop("Portugues") & "</a>")
		rsProcuraDVDTop.MoveNext
		ContadorTop = ContadorTop + 1
    Loop
	
	rsProcuraDVDTop.Close
	adoconTop.close
	set rsProcuraDVDTop = Nothing
	set adoConTop = Nothing
	%>
</div>	
</div>

<%
Dim adoConRecente
Dim strSQLRecente
Dim rsProcuraDVDRecente

Set adoConRecente = Server.CreateObject("ADODB.Connection")
adoConRecente.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("dbs\dvdsempelicas.mdb")
strSQLRecente = "SELECT top 10 Lista.Portugues, Lista.Chave FROM Lista WHERE Lista.Chave ORDER BY Lista.Chave DESC" 
Set rsProcuraDVDRecente = Server.CreateObject("ADODB.Recordset")
rsProcuraDVDRecente.Open strSQLRecente, adoConRecente
%>

<div id="LrRecente" style="position:absolute; left:8px; top:386px; width:225px; height:200px; z-index:4; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">
  <div align="center">
    <p><strong>.: Recentes :.</strong><br>
	
	<%
	Do While not rsProcuraDVDRecente.EOF
		response.Write("<br>")
		response.Write("<a href='mostrafilme.asp?Num=" & rsProcuraDVDRecente("Chave") & "' target='_blank'; style='text-decoration:none; color:#000000; font-size: x-small;'>" & rsProcuraDVDRecente("Portugues") & "</a>")
		rsProcuraDVDRecente.MoveNext
    Loop
	
	rsProcuraDVDRecente.Close
	adoconRecente.close
	set rsProcuraDVDRecente = Nothing
	set adoConRecente = Nothing
	%>
  </div>
</div>
<div id="LrMain" style="position:absolute; left:244px; top:141px; width:799px; height:513px; z-index:5; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000; color: #000000;">
  <p>NOTICIAS</p>
  <p>O Z&eacute; Barnab&eacute; tem um p&eacute; que cheira a chol&eacute;!</p>
</div>

<%
Sub BoasVindas (User)
Dim HoraFormatada
Dim NumeroHora

HoraFormatada = FormatDateTime(Time, 4)
NumeroHora = Left(HoraFormatada, 2)

If NumeroHora > 20 then
	response.write("Boa noite, " & User)
else
	If NumeroHora > 12 then
		response.Write("Boa tarde, " & User)
	else
		response.Write("Bom dia, " & User)
	end if
end if

End Sub
%>

</body>
</html>

This is the code that i have at the moment!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top