Ir para conteúdo
Fórum Script Brasil
  • 0

problemas com "DOCTYPE"


devhtml

Pergunta

Olá pessoal!

Tenho um código hiper simples e básico para mostrar uma tabela e em uma linha outra tabela, 100% de altura. Tinha esta página feita no FrontPage... e estava Ok!

E ao gerar pelo Visual Studio, e rodar, percebi que não funcionava nem no IE8 nem no Firefox...

Ai resolvi comentar a linha:

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

e funcionou.

Agora, como fazer funcionar no Visual Studio mesmo com esta linha que é adicionada por default ao criar uma WebForm.aspx?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="teste.aspx.cs" Inherits="WebApplication1.teste" %>

<html>

<head>

<title>New Page 1</title>

</head>

<body>

<table border="1" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%">

<tr>

<td bgcolor="#00FF00" style="width: 100%; height: 74px">&nbsp;</td>

</tr>

<tr>

<td style="width: 100%; height: 100%" bgcolor="#FF00FF">

<table border="1" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">

<tr>

<td width="100%" bgcolor="#0000FF">&nbsp;</td>

</tr>

</table>

</td>

</tr>

</table>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Certamente o erro não é o DOCTYPE. Veja se a localidade do code-behind está correta. Faça assim e compile:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="teste.aspx.cs" Inherits="WebApplication1.teste" %>
<!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">
...
</html>

Link para o comentário
Compartilhar em outros sites

  • 0

Olá!

Primeiramente obrigada pela atenção, mas continua não funcionando como esperado, ou seja, a tabela ficar 100% de altura, como fica quando removo o DocType. Alguma idéia?

Se eu colocar:

<style type="text/css">

html, body {height:100%; margin:0; padding:0;}

</style>

Tb não fica igual o resultado no Firefox 3..6.15 e IE8/9. Péssimo!! No Firefox fica PERFEITO e no IE não ! NO IE aparece um scroll vertical que na verdade é o tamanho da primeira linha que fixei a altura para 70px. Como deixar a página igual nos 2 browsers?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="teste.aspx.cs" Inherits="WebApplication1.teste" %>

<!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>

<title>New Page 1</title>

</head>

<body>

<table border="1" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%">

<tr>

<td style="width: 100%; height: 70px" bgcolor="#00FF00" >&nbsp;</td>

</tr>

<tr>

<td style="width: 100%; height: 100%" bgcolor="#FF00FF">

<table border="1" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">

<tr>

<td style="width: 100%; height: 100%" bgcolor="#0000FF">&nbsp;</td>

</tr>

</table>

</td>

</tr>

</table>

</body>

</html>

Editado por devhtml
Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...