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 : Download this code : Sample.html Note: Padding is the blank space between the inside edge of the browser window and the actual web page contents. Read more
No comments:
Post a Comment