Welcome Guest, please login or register.
Username:
Password:

News: Welcome to Hostpapa Forums!
Pages: [1]   Go Down
Topic Tools  
Read
July 01, 2011, 10:31:39 AM
Sync
Newbie
*
Posts: 2



Hello there. I have been looking all over the web on how to center the image, and I'm simply unable to. Here is the coding as I have right now: (Explanation of what I'm trying to do bellow it.)

index.html

Code:
<!DOCTYPE html>
<html>

<head>
<meta ch#%$!t="UTF-8">
<title>Snapr</title>
<link href='./Style.css' rel='stylesheet' type='text/css'>
</head>

<body id="view">
<div id="wrapper">
 
<h1>Snapr</h1>
 
<div id="screensnapr">
<h2><a href="http://screensnapr.com/">ScreenSnapr</a></h2>
<h3><a href="">Snapr</a></h3>
</div><!-- End #screensnapr -->
 
<div id="image">

<a href= <?php $img $_GET["img"]; ?> title="View Image"></a>

</div><!-- End #image -->

</div><!-- End #wrapper -->

<?php if($img=="") { echo ""; } else { echo "<img src='" $img "' />"; } ?>

</body>
</html>

My StyleSheet.css

Code:
body {
background:url(./background.gif) repeat top center;
border:0;
color:#FFF;
margin:0;
padding:0;
}

img {
border:0;
}

a {
outline:0;
text-decoration:none;
color:#FFF;
}

#wrapper {
display:table;
margin:80px auto;
}

h1 {
position:absolute;
left:-9999em;
}

#screensnapr {
overflow:hidden;
margin:0 0 15px 15px;
}

h2 {
width:112px;
height:17px;
background:url(./sprite.png) no-repeat 0 0;
float:left;
margin:0;
padding:0;
}

h2
a {
display:block;
text-indent:-9999em;
}

h3 {
font-size:11px;
float:left;
margin:2px 0 0 13px;
padding:0;
}

h3
a {
font:11px Arial, Helvetica, sans-serif;
color:#7f8083;
text-shadow:rgba(0,0,0,.75) 0 1px 0;
}

#image
a {
display:block;
margin:0 auto;
text-align:center;
}

#image
img {
-webkit-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
-moz-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
box-shadow:rgba(0,0,0,.40) 0 2px 3px;
max-height:800px;
max-width:100%;
display:block;
margin:0 auto;
text-align:center;
}

Now, basically what I'm trying to do is when ever a picture is uploaded into my directory and it has ' ?img= ' on the beggining of its URL it will display the background and the coding I provided above. I got that working; but what seems to be the easiest part is kicking me in the butt as off right now. I just need to center the image that is inside the image div.

Code:
<div id="image">

<a href= <?php $img $_GET["img"]; ?> title="View Image"></a>

</div><!-- End #image -->

I'm guessing the reason it is not centering it is because it has PHP coding inside of it? I'm not sure. Any help would be greatly appreciated.

BTW: I have tried CSS alignment and HTML alignment.
« Last Edit: July 01, 2011, 10:32:42 AM by Sync » Logged
 

Read
July 02, 2011, 03:32:36 AM
Inigo Montoya
Jr. Member
**
Posts: 85



Try this instead:

#image
img {
-webkit-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
-moz-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
box-shadow:rgba(0,0,0,.40) 0 2px 3px;
max-height:800px;
max-width:100%;
display:block;
margin-left:auto;
margin-right:auto;
}

you can find all CSS code here: http://www.w3schools.com/css/
Logged
 

Read
July 02, 2011, 08:53:51 AM
Sync
Newbie
*
Posts: 2



Try this instead:

#image
img {
-webkit-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
-moz-box-shadow:rgba(0,0,0,.40) 0 2px 3px;
box-shadow:rgba(0,0,0,.40) 0 2px 3px;
max-height:800px;
max-width:100%;
display:block;
margin-left:auto;
margin-right:auto;
}

you can find all CSS code here: http://www.w3schools.com/css/

It still did not work.. Any idea why?
Logged
 

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net