I want to style the membership status line at the top of each page. All the variables I want to include are in the following code which is working but I want to right justify the whole line, define font properties and add space between items displayed:
<?php
if (!Am_Lite::getInstance()->isLoggedIn()) {
echo Am_Lite::getInstance()->renderLoginForm();
echo '<a href="'.Am_Lite::getInstance()->getSignupURL().'">Sign up</a>';
} else {
echo 'Welcome '.Am_Lite::getInstance()->getUsername().'!
<a href="'.Am_Lite::getInstance()->getLogoutURL().'">Log out </a>';
echo '<a href="'.str_replace('/profile', '/member', Am_Lite::getInstance()->getProfileURL()).'">Account page</a>';
}
?>
You style your php output the same way you do for HTML. Put the output in some tags (div for example), and add a style argument to your tag. For your case, something like this will work:
<div style='width:100%;text-align:right;padding:5px;font:15px arial,sans-serif;'>
<?php
if (!Am_Lite::getInstance()->isLoggedIn()) {
echo Am_Lite::getInstance()->renderLoginForm();
echo '<a href="'.Am_Lite::getInstance()->getSignupURL().'">Sign up</a>';
} else {
echo 'Welcome '.Am_Lite::getInstance()->getUsername().'!
<a href="'.Am_Lite::getInstance()->getLogoutURL().'">Log out </a>';
echo '<a href="'.str_replace('/profile', '/member', Am_Lite::getInstance()->getProfileURL()).'">Account page</a>';
}
?>
</div>
<style>
.align-right {
width: 100%;
text-align: right;
}
</style>
<div class="align-right">content</div>
Fiddle: