Hello here is my script that fetches data from database and gives the result as pic attached.
<style>
.outer{margin:auto;;margin-top:15%; margin-left:18%; width:90%; }
</style>
<?php
$sql = "SELECT * FROM users WHERE gender='$sexlog' AND activated='1'";
$user_query = mysqli_query($db_conx, $sql);
while ($row = mysqli_fetch_array($user_query, MYSQLI_ASSOC))
{
$username=$row["username"];
$avatar = $row["avatar"];
$genderu=$row["gender"];
$data = $username.'<br/>';
$profile_picnew = '<a href="expressinterest.php?u='.$username.'"><img src="user/'.$username.'/'.$avatar.'" height="160" width="200"></a>';
if($avatar == NULL){
if($genderu == "f"){
$profile_picnew = '<a href="expressinterest.php?u='.$username.'"><img src="css/images/girl.gif" height="160" width="200"></a>';
}
else { $profile_picnew = '<a href="expressinterest.php?u='.$username.'"><img src="css/images/boy.gif" height="160" width="200"></a>';
}
echo '<div class="outer"><div style="float:left; margin-left:3%; border:1px solid silver;">'.$profile_picnew.''.$data.' </div><div>';
}}
?>
result–
Source code:-
<div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=sonam”><img src=“css/images/girl.gif” height=“160” width=“200”></a>sonam<br/> </div><div><div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=aishwariya”><img src=“css/images/girl.gif” height=“160” width=“200”></a>aishwariya<br/> </div><div><div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=meena”><img src=“css/images/girl.gif” height=“160” width=“200”></a>meena<br/> </div><div>
<!doctype html>
<html>
<head>
<meta charset=“utf-8”>
<title>Mycrush-shail</title>
<style>
.outer{margin:auto;;margin-top:15%; margin-left:18%; width:90%; }
</style>
</head>
<body>
<div></div>
</body>
</html>
when i made the change in above query like this,then result become distorted like pic2. WHy>
<style>
.outer{margin:auto;;margin-top:15%; margin-left:18%; width:90%;border:1px solid green; overflow: hidden; }
</style>
resullt-
Source code-
<div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=sonam”><img src=“css/images/girl.gif” height=“160” width=“200”></a>sonam<br/> </div><div><div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=aishwariya”><img src=“css/images/girl.gif” height=“160” width=“200”></a>aishwariya<br/> </div><div><div class=“outer”><div style="float:left; margin-left:3%; border:1px solid silver; "><a href=“expressinterest.php?u=meena”><img src=“css/images/girl.gif” height=“160” width=“200”></a>meena<br/> </div><div>
<!doctype html>
<html>
<head>
<meta charset=“utf-8”>
<title>Mycrush-shail</title>
<style>
.outer{margin:auto;;margin-top:15%; margin-left:18%; width:90%;border:1px solid green; overflow: hidden; }
</style>
</head>
<body>
<div></div>
</body>
</html>
i want the result like pic 1 but showing the border in div outer also.