Geocrafter Geocrafter - 2 months ago 7
CSS Question

How to place items exactly where you want to CSS

Alright, so this is my HTML right now.

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>GeoVillage - A Community</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id=header>
<img id=logo src="/logo.png" alt="GeoVillage Community" style="width:500px;height:128px;">
<span id=logreg>
<?php
if(isset($_SESSION['loggedon']) && $_SESSION['loggedon'] == true){
echo '<a href=/logout>
<img id=logout src="/logout.png" alt="Logout">
</a>';
} else {
echo '<a href=/login>
<img id=login src="/login.png" alt="Login">
</a>';
echo '<a href=/login/register.php>
<img id=register src="/register.png" alt="Register">
</a>';
}
?>
</span>
</div>
<ul>
<li><a href="/vatsim">FSX/X-P/P3D Vatsim Online Material</a></li>
<li><a href="/dev2">Development Page</a></li>
</ul>
<?php
echo($_SESSION["loggedon"]);
?>
</body>
</html>


And this is my CSS file.

body{
background-color: #33ccff;
margin: 0px;
}

#header{
display:inline;


Right now, the Login and Register buttons are at the top, but aligned essentialy with the bottom of the banner. How would i position it so it would be aligned with the top of the banner?

Answer

Try this

#logreg {vertical-align: top;display: inline-block;}
Comments