View Full Version : Simple page with image

07-20-2011, 05:31 PM

I want to create a simple page with background image and a image on the center of the page. Screenshot (http://www.codingforums.com/attachment.php?attachmentid=10082&stc=1&d=1311173080)

<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
background-color: #CCC;
background-image: url(bg.png);
vertical-align: middle;
background-repeat: repeat-x;
height: auto;


.container {
vertical-align: middle;


<div class="container">
<div align="center"><img src="image.png" align="middle" style="padding-top:30px; padding-bottom:30px; verticle-align: middle; vertical-align: middle;" /></div>

Please help me creating this webpage. From the above code i get this result Screenshot (http://www.codingforums.com/attachment.php?attachmentid=10087&stc=1&d=1311175690)

07-20-2011, 07:40 PM
try taking a 1 px slice of that purple/black "image" and then try doing

background:url('pathofslice') repeat-x;
background:url('pathofimage') no-repeat center center;
idk if it'll work, first thought*

07-21-2011, 03:37 PM
I have changed the above code and using table code

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

So now the image appeared at the center. don't know how to take slice so now using a different background