Can anyone help me figure out why my sidebar is not positioning correctly next to the content on the right side? No matter what I try, it keeps going underneath the content. Here's the CSS code I'm using:
body {
font: 10pt Calibri, Helvetica;
background: #E8E8E8;
margin: 0;
}
h2 {
font-size: 1.1em;
color: #1C1C1C;
margin-bottom: 0;
}
#wrapper {
width: 990px;
margin: 0 auto;
}
#header{
width:100%;
height:150px;
background-color:#0000FF;
color:#1C1C1C;
font-size: 20px;
}
#sidebar {
width: 250px;
height: 300px;
float: right;
background: #FF69B4;
}
#content {
background: #FF4500;
margin-right: 220px;
width: 700px;
word-break: break-all;
color:#1C1C1C;
font-size: 10px;
}
#footer {
height: 50px;
color: #fff;
background: #000;
clear: both;
}
This is part of one of my pages:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">
<table border="0" cellpadding="50">
<tr>
<th><a href='/first.php' target="content" style="color: #E8E8E8">Home</a></th>
<th><a href='/search.php' target="content" style="color: #E8E8E8">Search</a></th>
<th><a href='/2.php'target="content" style="color: #E8E8E8">Ask Question</a></th>
<th><a href='/3.php'target="content"style="color: #E8E8E8">Contact Us</a></th>
<th><a href='/all_list.php'target="content" style="color: #E8E8E8">Admin Panel</a></th>
<th><a href='/category.php'target="content" style="color: #E8E8E8">Categories</a></th>
</tr>
</table>
</div>
<div id="wrapper">
<div id="content">
<h1 align="center">Administrator Page</h2>
<?php
$conn = mysql_connect ("localhost", "root", "") or die ("Unable to connect!");
mysql_select_db('university');
mysql_query("SET NAMES 'utf8'");
echo '<table border="1" cellspacing="0" cellpadding="12" align="center">';
echo '<thead>';
echo '<tr>';
echo '<th>ID</th>';
echo '<th>Name</th>';
echo '<th>1</th>';
echo '<th>2</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$res = mysql_query("SELECT * FROM news");
while($news = mysql_fetch_assoc($res)) {?>
<tr>
<td><a href="detail.php?id=<?=$news['id']?>"><?=$news['id']?></td>
<td><a href="detail.php?id=<?=$news['id']?>"><?=$news['program']?></td>
<td><a href="delete.php?id=<?=$news['id']?>">Delete</td>
<td><a href="edit_form.php?id=<?=$news['id']?>">Edit</td>
</tr><?
}?>
</tbody></table>
<form name="add" action="add_form.php">
<p><input type="submit" value="Add Program"></p>
</div>
<div id="sidebar">
<h2>Here i will have sidebar</h2>
</div>
</div>
</body>
</html>