Primeramente hola ....
Para optimizar la compatibilidad entre navegadores y los standards web. Te recomiendo utilizar un (reset CSS).
Esto lo que viene hacer es resetar tu hoja de estilos con valores por defecto.
Un reset css lo puedes encontrar desde
aquí.
Su uso es sencillo lo puedes indexar a tu hoja de estilos y guardar en la misma carpeta que tu css de la siguiente forma.:
Código :
@import url("reset.css");
/*!!!! Y de aqui sigues con tu hoja de estilos normal !!!!*/
#maintxt {
position: absolute;
width: 390px;
height: 480px;
background-color: #999999;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 22px;
text-align:right;
font-weight:bold;
}
O lo puedes simplemente dejar arriba de tu hoja de estilos de la siguiente forma......
Código HTML :
<head>
<title>Untitled Document</title>
<style type="text/css">
/*!!!! Aquí esta el reset !!!!*/
html,body,div,span,
applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
dd,dl,dt,li,ol,ul,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td {
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
font-style: normal;
font-size: 100%;
line-height: 1;
font-family: inherit;
text-align: left;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
ol,ul {
list-style: none;
}
q:before,q:after,
blockquote:before,blockquote:after {
content: "";
}
/*!!!! Y de aqui sigues con tu hoja de estilos normal !!!!*/
#maintxt {
position:absolute;
width: 390px;
height: 480px;
background-color: #999999;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 22px;
text-align:right;
font-weight:bold;
}
</style>
</head>
<body>
<div id="maintxt">
<h1>Qué es esto?</h1>
</div>
</body>
</html>
Ahora simplemente para solucionar tu problema solo con anidar un (margin = 0) en tu (h1)
Y como mucho un (padding = 0).
bastaría....
Código HTML :
<head>
<title>Untitled Document</title>
<style type="text/css">
#maintxt {
position:absolute;
width: 390px;
height: 480px;
background-color: #999999;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 22px;
text-align:right;
font-weight:bold;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="maintxt">
<h1>Qué es esto?</h1>
</div>
</body>
</html>
Espero haberte ayudado cualquier duda dime......