Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML CSS

Top margin Gap in google Chrome

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

Moderators: macek, egami, gesf

Top margin Gap in google Chrome

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

Hello,

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.

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

header.php:
<!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>
<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" />

</head>

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

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


Thanks in advance
Attachments
Untitled-1.png
print screen problem
Untitled-1.png (8.85 KiB) Viewed 1175 times
rprmatias
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Dec 28, 2011 5:06 am

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.
User avatar
L33R
New php-forum User
New php-forum User
 
Posts: 133
Joined: Fri Dec 30, 2011 4:27 am
Location: Liverpool

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)
phpdhanapal
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Feb 17, 2012 10:26 pm


Return to CSS

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.