Top margin Gap in google Chrome

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Wed Dec 28, 2011 5:06 am

Top margin Gap in google Chrome

Postby rprmatias » Wed Dec 28, 2011 5:21 am


My name is Rui, I'm from Portugal and I'm learning php code, I start to build my first php site, and I have this problem,

In my home page (index.php) I have a gap in the top margin (see the attach image), just in Google Chrome, I've tried almost everything, and is the only browser that I have this problem. Next see the code for the header, index and css. I want to my site start from the edge of the monitor.

<?php include('header.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Romã Extreme Care</title>
<meta name="author" content="Rui Matias" />
<meta name="description" content="XXX" />
<meta name="language" lang="pt" content="Portuguese" />
<meta name="keywords" lang="pt" content="XXX" />
<meta name="copyright" content="Rom&atilde; Extreme Care" />
<link rel="shortcut icon" href="imagens/ico.png" />
<link rel="stylesheet" href="scripts/main.css" type="text/css" media="screen" />


<div id="header"></div><!--HEADER-->

body {
margin: 0px;
padding: 0px;
#header {
width: 900px;
height: 200px;
margin: 0;
padding: 0;
background-color: #000;
display: block;

Thanks in advance
print screen problem
Untitled-1.png (8.85 KiB) Viewed 1810 times

User avatar
New php-forum User
New php-forum User
Posts: 144
Joined: Fri Dec 30, 2011 4:27 am
Location: Liverpool

Re: Top margin Gap in google Chrome

Postby L33R » Wed Feb 15, 2012 3:48 pm

I have just copied your code and ran it in chrome.

I dont get any spaces above your header.

try clearing your cache.

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Feb 17, 2012 10:26 pm

Re: Top margin Gap in google Chrome

Postby phpdhanapal » Fri Feb 17, 2012 10:34 pm

/*----- 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,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit;
font-size: 100%; font-family: inherit; vertical-align: baseline; }
html { display: block; }

Copy and paste the above in your css style sheet file in top. 8)

Return to “CSS”

Who is online

Users browsing this forum: No registered users and 2 guests