▼  Site Navigation Main About Search Articles  ▼  Anime + Manga Anime Reviews Anime Characters Gallery Screenshots Manga Reviews  ▼  Misc News Links to Webcomics Bible Quotes Member Control Panel  ▼  Forum etc. Forums Older Musings Wordpress
site version 7.3
Horizontally and Vertically center an image
written by: admin


Date Written: 5/14/12 Last Updated: 5/14/12

The following code is for a horizontally and vertically centered background image.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Centered Image</title>
<style type="text/css">
html {
   width:100%;
   height:100%;
   background:url(images/lain.jpg) center center no-repeat;
        background-color:rgb(201,228,255);
}
</style>
</head>
<body>

</body>
</html>

demo

TAGS: css
copyright 2005–2018