Monday, May 17, 2010

Remove browser padding or the extra space around web page contents using CSS

In Internet Explorer, an extra space is placed around the web page .

To remove them , use this following code :

<!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=iso-8859-1" />
<title>:: My Website ::</title>
<style type="text/css">
*
{
margin:0 ;
}

body
{
background-color:grey;
}
#con
{
margin:auto;
width:800px;
height:600px;
background-color:white;
text-align:center
}
</style>
</head>

<body>
<div id="con">
<h1>Welcome</h1>
This works the body is showing at center of the window
</div>
</body>
</html>

Snapshot of this code :



Note: Padding is the blank space between the inside edge of the browser window and the actual web page contents.


No comments:

Post a Comment

Welcome

Author

It is IT related blog site and Experiences of Zahid Bin A. Rouf, which has posts on technology,tips and tricks,links,troubleshoot,tutorials,computer related suggestions,reviews

Subscribe

Like Us

bangladesh-data
Bangladesh-data Blog
CodeInclude
CodeInclude Blog
tictactoe
TicTacToe Game

Bangladesh Info

CodeInclude

"There are two blessings which many people lose: (They are) Health and free time for doing good."

~Narrated by Ibn 'Abbas
~Said by Prophet Muhammad (sallallahu alayhi wasallam)
[Ref: Bukhari Hadith:Volume 8, Book 76:Softening the Heart, Number 421 ]

Pageviews last month

Flickr