sidebar height is upto something is written - php

I am not able to make the sidebar all the way touch to the footer earlier it was going to the bottom but i made few changes for hours and suddenly when i checked it sidebar color only shows till it displays some links.
css:
*{margin:0; padding:0;}
html{ width:1024px; height:100%; margin: 0 auto; }
body{ width:100%;height:100%;
margin:0; padding:0; border:0;
font-family:Verdana,Helvetica,Arial,sans-serif;
font-size: 13px; line-height: 16px;
background: #FFFFFF; text-align: center;
display: table;
}
#main { height:auto; min-height:100%; }
/* header */
#header{
background-color:#c42000;
height:75px; margin:0; padding:0;
border:0 solid;
}
#header h1{
line-height:15px; padding:1em;
}
#header h1 a{
color:#FFFFFF;
text-decoration:none;
}
#header h1 a:hover {
color:#cda154;
}
/* Navigation */
#navigation {
color:#d3d3d3;
height:45px;
background:#262525;
float:top;
}
#navigation .subjects {
background: #262525;
float: left;
font-weight:bold;
margin: 0; padding: 0;
border-bottom: none;
}
#navigation .subjects li a, #navigation .subjects li {
float: left;
}
#navigation .subjects li {
list-style: none;
position: relative;
}
#navigation .subjects li a {
padding: 1em 2em;
text-decoration: none;
color: white;
background: #292929;
border-right: 1px solid #3c3c3c;
border-left: 1px solid #292929;
border-bottom: 1px solid #232323;
border-top: 1px solid #545454;
}
#navigation .subjects li a:hover {
background: #302f2f; color:#16a9e0;
}
/* Submenu */
#navigation .subjects li ul {
display: none;
pos
ition: absolute;
left: 0;
top: 100%;
padding: 0; margin: 0;
}
#navigation .subjects li:hover > ul {
display: block;
}
#navigation .subjects li ul li, #navigation.subjects li ul li a {
float: none;
}
#navigation .subjects li ul li {
_display: inline; /* for IE6 */
}
#navigation .subjects li ul li a {
width: 150px;
display: block;
}
/* Sidebar */
#sidebar {
float:right;
width: 150px; height: 100%;
margin: 0; padding: 0 2em;
color: #D4E6F4; background: #16aae2;
}
#sidebar a { color: #D4E6F4; text-decoration: none; }
#sidebar a:hover { color: #FFFFFF; }
/* footer */
#footer {
clear: both; position: relative;
height: 2em; margin: 0; padding: 1em; margin-top: -3em; z-index:10;
text-align: center;
background: #000000; color: #D4E6F4;
}
/* page */
#page {
display:table-cell;
float:left;
line-height: 30px;
text-align: left;
padding: 2em;
}
h2 { color:#c42000; }
div.message,div.error {
color: #8D0D19; font-weight:bold;
margin: 1em 0; padding: 1em;
}
div.images {
width:92;height:92; float:left; padding: 0 10px 0; display:block;
}
div.images a{ text-decoration:none;}
php:
<?php require_once("../includes/session.php"); ?>
<?php require_once("../includes/db_connection.php"); ?>
<?php require_once("../includes/functions.php"); ?>
<?php $layout_context = "admin"; ?>
<?php include("../includes/layouts/header.php"); ?>
<?php find_selected_page(); ?>
<div id="main">
<div id="navigation">
<?php echo navigation($current_subject, $current_page); ?>
</div>
<div id="page">
<?php echo message(); ?>
<?php if(isset($current_subject)) {?>
<h2>Manage Subject</h2>
Menu name: <?php echo htmlentities($current_subject["menu_name"]); ?><br />
Position: <?php echo $current_subject["position"]; ?><br />
Visible: <?php echo $current_subject["visible"] == 1 ? 'yes' : 'no'; ?><br /><br />
<a href="edit_subject.php?subject=<?php echo urlencode($current_subject["id"]); ?>
">Edit Subject</a>
<div style="margin-top: 2em; border-top: 1px solid #000000;">
<h2>Pages in this subject:</h2>
<?php
$subject_pages = find_pages_for_subject($current_subject["id"]);
while($page = mysqli_fetch_assoc($subject_pages)) {
$safe_page_id = urlencode($page["id"]);
echo "<a href=\"manage_content.php?page={$safe_page_id}\">";
echo htmlentities($page["menu_name"]);
echo "</a><br />";
}
?>
<br />
+ Add a new page to this subject
</div>
<?php }elseif($current_page) {?>
<h2>Manage Page</h2>
<?php ?>
Page Name: <?php echo htmlentities($current_page["menu_name"]); ?><br />
Position: <?php echo $current_page["position"]; ?><br />
Visible: <?php echo $current_page["visible"] == 1 ? 'yes' : 'no'; ?><br />
<br />
<br />
Edit Page<br /><br />
<?php echo display_image_by_id(); ?>
<?php }else { ?>
Please Select a Subject or Page.
<?php } ?>
</div>
<div id="sidebar">
« Main Menu
<br />
<br />
+ Add a subject
</div>
</div>
<?php include("../includes/layouts/footer.php"); ?>

Related

Drop down bottom disappier when move mouse cursor on it

I've got a problem : when i try to move the cursor of the mouse on the sub-menu of the drop down, for some motive it disappier.
I try to check in file css end in its file js but at the third day again i didn't find the solutions..i think that could be some problem with [block] in class css. does someone see if there something that wrong end eventually how could operate to resolve this problem? under here post an image with the code.
Thank in advance.
Here another image...maybe understanding better:
here the code about the top-link :
/* ======================================================================================= */
--> .top-link { background: #f7f7f7;line-height: 35px; position: relative;color: #6a6a6a; border-bottom: 1px solid #d8d8d8;}
.form-language, .form-currency { float: left;}
.form-language label { display: none;}
.form-language select, .form-currency select { padding: 4px 10px; background: #f2f2f2;}
p.welcome-msg { margin: 0 0 0 25px; float:left; padding: 5px 0;}
.top-link ul.links { padding: 5px 0;}
.top-link ul.links li { padding:0 15px 0 0; float: left;}
.top-link ul.links li a { color: #6a6a6a;font-size: 11px;text-transform: uppercase; }
.top-link ul.links li a:hover { }
.call-phone{text-align: right;}
.call-phone span{color:#999;font-weight: bold;}
here the code about bottom Drop down :
.drop-lang {
list-style: none;
padding: 0;
margin: 0;float: right;
}
.drop-lang .drop-trigger {
position: relative;
z-index: 9999;
float: right;
padding: 0 5px 0 10px;
}
.drop-lang li a {
position: relative;
padding: 5px 0 5px 0;
display: block;
color: #6a6a6a;
text-transform:uppercase;
font-weight: normal;
font-size: 11px;
z-index: 9999;
}
.drop-lang .drop-trigger .sub-lang {
position: absolute;
top:40px;
left:-1px; /* dropdown left or right */
list-style: none;
padding:0 11px 0 4px;
margin: 0;
display: none;
background: #f7f7f7;
border: 1px solid #d8d8d8;
border-top: none
z-index: 9999;
}
.drop-lang .drop-trigger:hover .sub-lang {
top:45px;
display: block;
}
.drop-lang .sub-lang li a { padding: 0 5px; line-height: 22px; display: block; color: #666; text-transform:uppercase; font-weight: normal; font-size: 11px; border-top: 1px solid #d8d8d8; border-right:0;border-left:0; border-bottom:0; border-radius:0;}
.drop-lang .sub-lang li a:hover { }
Html/php part :
<?php if(count($this->getStores())>1): ?>
<div class="form-language">
<label for="select-language"><?php echo $this->__('Language:') ?></label>
<ul class="drop-lang">
<li class="drop-trigger">
<?php foreach ($this->getStores() as $_lang): ?>
<?php if($_lang->getId() == $this->getCurrentStoreId()): ?>
<a class="<?php echo $_lang->getCode() ?>" href="<?php echo $_lang->getCurrentUrl() ?>"><?php echo $this->htmlEscape($_lang->getName()) ?><i class="fa fa-angle-down"></i></a>
<?php endif?>
<?php endforeach; ?>
<ul class="sub-lang">
<?php foreach ($this->getStores() as $_lang): ?>
<?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' class="selected"' : '' ?>
<li><a class="<?php echo $_lang->getCode() ?>" href="<?php echo $_lang->getCurrentUrl() ?>"<?php //echo $_selected; ?>><?php echo $this->htmlEscape($_lang->getName()) ?></a></li>
<?php endforeach; ?>
</ul>
</li>
</ul>
</div>
<?php endif; ?>
Try the fiddle at - https://jsfiddle.net/456f2sf7/
.drop-lang .drop-trigger:hover .sub-lang {
top:20px;//Updated value
display: block;
}
Just decreasing the top margin to 20px, ensures that the dropdown does not disappear as it is visible only on hover.

Breadcrumb - How to change the element according to the page?

I am trying to create a forum software and I would like when my breadcrumb links, change depending on what I clicked:
And:
Here is how my files are coordinated:
header.php, index.php, members.php, css/style.css
I would like that the element automatically changes according to the clicked page.
header.php code:
<div id="top_bar">
<div class="wrapper">
<div id="top_bar_links">
<ul>
<?php
$full_name = $_SERVER["PHP_SELF"];
$name_array = explode("/",$full_name);
$count = count($name_array);
$page_name = $name_array[$count-1];
?>
<li>
<a class="<?php echo ($page_name=="index.php")?"active":"";?>" href="index.php">Forums</a>
</li>
<li>
<a class="<?php echo ($page_name=="members.php")?"active":"";?>" href="members.php">Members</a>
</li>
</ul>
</div>
</div>
</div>
<div id="header">
<div class="wrapper">
<h1 id="logo">
NextGenFocus
</h1>
<div id="user_links">
<ul>
<li id="sign_up">
Sign Up
</li>
<li id="sign_in">
Sign In
</li>
</ul>
</div>
</div>
</div>
<div class="wrapper">
<div id="container">
<div id="breadcrumb_top">
<div class="breadcrumb_links">
<ul>
<li class="forums">
Forums
</li>
</ul>
</div>
</div>
</div>
</div>
index.php and members.php code:
<?php
include "header.php";
?>
style.css code:
/* CORE */
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
margin: 0;
}
h1 {
font-size: 25px;
}
h2 {
font-size: 20px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 17px;
}
h5 {
font-size: 15px;
}
h6 {
font-size: 13px;
}
body {
background-color: #e6e9ed;
color: #000;
font-family: "Trebuchet MS", sans-serif;
font-size: 13px;
margin: 0;
padding-bottom: 15px;
}
.wrapper {
width: 980px;
margin: 0 auto;
}
a {
color: #4d7799;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
p {
margin: 0;
}
/* TOP BAR */
#top_bar {
background-color: #262d35;
height: 55px;
}
#top_bar_links ul {
list-style: none;
margin: 0;
padding: 0;
}
#top_bar_links a {
color: #fff;
opacity: 0.6;
float: left;
display: block;
line-height: 55px;
padding: 0 25px;
}
#top_bar_links a:hover {
background-color: #000;
opacity: inherit;
text-decoration: none;
}
#top_bar_links a.active {
background-color: #000;
opacity: inherit;
}
#top_bar_links a:hover {
background-color: #000;
opacity: inherit;
text-decoration: none;
}
/* HEADER */
#header {
background-color: #3d5e78;
height: 115px;
margin-bottom: -25px;
}
#logo {
float: left;
}
#logo a {
color: #fff;
font-size: 25px;
line-height: 90px;
}
#logo a:hover {
text-decoration: none;
}
#user_links li {
float: right;
}
#user_links ul {
list-style: none;
margin: 0;
padding: 0;
}
#user_links a {
color: #fff;
line-height: 90px;
margin-left: 15px;
}
/* CONTAINER */
#container {
background-color: #fff;
box-shadow: rgba(0,0,0,0.3) 0px 1px 7px;
padding: 15px;
}
#breadcrumb_top {
background-color: #f5f5f5;
height: 45px;
margin: -15px -15px 15px -15px;
}
#breadcrumb_bottom {
background-color: #f5f5f5;
height: 45px;
margin: 0 -15px -15px -15px;
}
.breadcrumb_links ul {
list-style: none;
margin: 0;
padding: 0;
}
.breadcrumb_links li {
float: left;
}
.breadcrumb_links a {
color: #000;
line-height: 45px;
margin-left: 15px;
}
.separator {
margin-left: 10px;
}
It seems you need to put something dynamic where you presently have 'Forums'. You have your pagename (members.php) in the variable $page_name, so try this:
<?php echo ucfirst(str_replace('.php', '', $page_name)) ?>
That will remove the ".php" from the string (so it turns into "members") and then upper-case the first letter (so it turns into "Members"). Don't be afraid to try out some other string operations if you need to adjust it further!

Menu item wont align right

Hey I am making a menu for a website for a project I am doing and I couldn't get the Menu item "Login" to align right. I would appreciate it if someone would help me. Also I would be happy to give you any other parts of the code you need. Thanks Joshua
CSS Code
html, body {
padding: 0;
margin: 0;
}
body {
background-color: #fff;
font-family: Arial;
font-size: 14px;
color: #000;
padding: 0;
margin: 0;
}
h1, h2, h3 {
margin-bottom: 40px;
}
p {
margin-bottom: 10px;
line-height: 22px;
}
.title-box {
font-size: 25px;
padding: 15px;
background-color: #fff;
color: #fff;
font-weight: 700;
}
.title-box a {
color: #fff;
text-decoration: none;
}
.header {
background-color: #42444f;
/*margin:20px 10px 0 10px;*/
margin: 0;
color: #acadb1;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.5px;
}
.header_left_box {
float: left;
}
.header_right_box {
float: right;
}
.header a {
text-decoration: none;
}
.header li.active a,
.header li.active:hover a {
color: #fff;
background-color: #2c2f3b;
}
.header li:hover a {
color: #fff;
}
.content {
padding: 45px 35px;
margin: 0;
min-height: 250px;
}
.content a {
text-decoration: underline;
color: #2C2F3B;
}
.footer {
background-color: #42444f;
color: #acadb1;
font-size: 15px;
font-weight: bold;
padding: 30px 35px;
margin: 0;
}
h1 {
font-size: 40px;
margin-top: 0;
}
h2 {
font-size: 25px;
margin-top: 0;
}
.feedback {
border: 1px solid black;
color: black;
padding: 20px;
font-size: 16px;
margin-bottom: 35px;
}
.feedback.error {
border: 1px solid red;
color: red;
}
.feedback.success {
border: 1px solid green;
color: green;
}
ul#menu, ul#menu ul.sub-menu {
padding:0;
margin: 0;
}
ul#menu {
}
ul#menu li, ul#menu ul.sub-menu li {
list-style-type: none;
display: inline-block;
}
ul#menu li {
margin-left: -4px;
}
ul#menu li:first-of-type {
margin-left: 0;
}
ul#menu ul.sub-menu {
padding-bottom: 5px;
}
ul#menu ul.sub-menu li {
margin-left: 0;
}
ul#menu li a {
color: #acadb1;
text-decoration: none;
padding: 15px;
font-weight: bolder;
}
ul#menu li a, ul#menu li ul.sub-menu li a {
text-decoration: none;
display:inline-block;
white-space: nowrap;
}
ul#menu li a:hover {
color: #fff;
}
ul#menu li.active a {
color: #fff;
}
ul#menu li.active ul a {
color: #acadb1;
}
ul#menu li ul.sub-menu li a:hover {
color: #fff;
}
ul#menu li {
position: relative;
}
ul#menu li ul.sub-menu {
display:none;
position: absolute;
top: 44px;
left: 0;
background-color: #42444f;
}
ul#menu li.active ul.sub-menu {
background-color: #2c2f3b;
}
ul#menu li ul.sub-menu li a {
padding: 10px 15px;
font-size: 12px;
}
ul#menu li:hover ul.sub-menu {
display:block;
}
.header .namebox {
float: right;
background-color: #1e2029;
color: #FFFFFF;
font-size: 14px;
font-weight: bold;
height: 100%;
line-height: 44px;
padding: 0 30px;
text-decoration: none;
}
.header .avatar {
float: left;
width: 44px;
height: 44px;
}
input, select, textarea {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
label {
display: block;
margin-bottom: 5px;
line-height: 20px;
}
input {
display: block;
margin-bottom: 15px;
padding: 10px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
border: 1px solid #ddd;
color: #555;
font-weight: bold;
}
input[type="submit"] {
border: 0;
background-color: #2C2F3B;
color: #fff;
font-weight: bold;
cursor: pointer;
}
.remember-me-checkbox {
float: left; min-width: 0; margin: 3px 10px 15px 0;
}
.remember-me-label {
float:left; min-width: 0; font-size: 12px; color: #888;
}
.login-submit-button {
float: none; clear: both;
}
.login-form-password-pattern-reminder {
display: block;
color: #999;
font-size: 11px;
}
.login-default-box,
.login-facebook-box {
display: inline-block;
width: 300px;
vertical-align: top;
}
a.facebook-login-button,
a.facebook-register-button {
background-color: #3b5998;
color: #fff;
text-decoration: none;
font-size: 16px;
font-weight: bolder;
padding: 15px 20px;
border-radius: 4px;
}
a.facebook-login-button:hover,
a.facebook-register-button:hover {
background-color: #2f477a;
}
.register-default-box,
.register-facebook-box {
display: inline-block;
width: 300px;
vertical-align: top;
}
.clear-both {
clear: both;
}
.debug-helper-box {
position: fixed;
bottom: 20px;
right: 0;
padding: 20px;
color: #fff;
background-color: red;
font-weight: bold;
}
#media only screen and (max-width:800px) {
.header_left_box,
.header .avatar {
float: none;
}
.header_right_box {
width: 100%;
background-color: #1E2029;
}
ul#menu li {
width: 100%;
text-align: center;
margin-left: 0;
}
ul#menu li a {
display: block;
}
ul#menu li ul.sub-menu {
display: block;
position: relative;
top: 0;
}
ul#menu li ul.sub-menu li {
font-size: 12px;
background-color: #4a4c55;
}
ul#menu li.active ul.sub-menu li {
background-color: #2C2F3B;
}
ul#menu ul.sub-menu {
padding-bottom: 0;
}
}
.avatar img {
width: 44px;
height: 44px;
}
table{
border-collapse: collapse;
border-spacing: 0;
border: 1px solid black;
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
height:100%;
margin:0px;padding:0px;
} tr:last-child td:last-child {
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
}
table tr:first-child td:first-child {
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
}
table tr:first-child td:last-child {
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
} tr:last-child td:first-child{
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
} tr:hover td{
background-color:#ffffff;
}
td{
vertical-align:middle;
background-color:#ffffff;
border:1px solid #000000;
border-width:0px 1px 1px 0px;
text-align:left;
padding:7px;
font-size:10px;
font-family:Arial;
font-weight:normal;
color:#000000;
} tr:last-child td{
border-width:0px 1px 0px 0px;
} tr td:last-child{
border-width:0px 0px 1px 0px;
} tr:last-child td:last-child{
border-width:0px 0px 0px 0px;
}
tr:first-child td{
background:-o-linear-gradient(bottom, #ff7f00 5%, #ff0000 100%); background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ff7f00), color-stop(1, #ff0000) );
background:-moz-linear-gradient( center top, #ff7f00 5%, #ff0000 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff7f00', endColorstr='#ff0000'); background: -o-linear-gradient(top,#ff7f00,ff0000);
background-color:#ff7f00;
border:0px solid #000000;
text-align:center;
border-width:0px 0px 1px 1px;
font-size:14px;
font-family:Arial;
font-weight:bold;
color:#ffffff;
}
tr:first-child:hover td{
background:-o-linear-gradient(bottom, #ff7f00 5%, #ff0000 100%); background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ff7f00), color-stop(1, #ff0000) );
background:-moz-linear-gradient( center top, #ff7f00 5%, #ff0000 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff7f00', endColorstr='#ff0000'); background: -o-linear-gradient(top,#ff7f00,ff0000);
background-color:#ff7f00;
}
tr:first-child td:first-child{
border-width:0px 0px 1px 0px;
}
tr:first-child td:last-child{
border-width:0px 0px 1px 1px;
}
Menu Code
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Login</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?php echo URL; ?>application/libs/css/reset.css" />
<link rel="stylesheet" href="<?php echo URL; ?>application/libs/css/style.css" />
<script type="text/javascript" src="//code.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="<?php echo URL; ?>application/libs/js/application.js"></script>
</head>
<body>
<div class='title-box'>
<img src=''>
</div>
<div class="header">
<div class="header_left_box">
<ul id="menu">
<li <?php if ($this->checkForActiveController($filename, "index")) { echo ' class="active" '; } ?> >
Forum
</li>
<li <?php if ($this->checkForActiveController($filename, "helpcenter")) { echo ' class="active" '; } ?> >
Help Center
</li>
<?php if (Session::get('user_logged_in') == true):?>
<li <?php if ($this->checkForActiveController($filename, "dashboard")) { echo ' class="active" '; } ?> >
Dashboard
</li>
<?php endif; ?>
<?php if (Session::get('user_logged_in') == true):?>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
My Account
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Change account type
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Upload an avatar
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my username
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my email
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my password
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Logout
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 1):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 2):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
Teacher
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 3):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
Teacher
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "admin")) { echo ' class="active" '; } ?> >
Admin
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "admin")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_logged_in') == false):?>
<li class='right' <?php if ($this->checkForActiveControllerAndAction($filename, "login/index")) { echo ' class="active" '; } ?> >
Login
</li>
<?php endif; ?>
</ul>
</div>
<?php if (Session::get('user_logged_in') == true): ?>
<div class="header_right_box">
<div class="namebox">
Hello <?php echo Session::get('user_name'); ?>!
</div>
<div class="avatar">
<?php if (USE_GRAVATAR) { ?>
<img src='<?php echo Session::get('user_gravatar_image_url'); ?>'
style='width:<?php echo AVATAR_SIZE; ?>px; height:<?php echo AVATAR_SIZE; ?>px;' />
<?php } else { ?>
<img src='<?php echo Session::get('user_avatar_file'); ?>'
style='width:<?php echo AVATAR_SIZE; ?>px; height:<?php echo AVATAR_SIZE; ?>px;' />
<?php } ?>
</div>
</div>
<?php endif; ?>
<div class="clear-both"></div>
</div>
.header_left_box { }
ul#menu li:last-child {
float: right;
}
As I stated earlier, you need to restructure your menu code for this to work. This works http://jsfiddle.net/andyjh07/MVzR7/
Try adding float:right to ul#menu
ul#menu {
float:right;
}
If it'll not work then I have to see some working demo of your code.
UPDATE
http://jsfiddle.net/dwebexperts/fL3tG/
I think I got the issue. Your code is:-
<div class="header_left_box">
Your menu is here I think
</div>
<div class="header_right_box">
//Your other code
</div>
AND
Your CSS is:-
.header_left_box {
float: left;
}
.header_right_box {
float: right;
}
It shows that div containing your Menu will be on left side. You have to inter-change the classes of both the divs or you can take your menu our of this div <div class="header_left_box">
Remove width: 100%; from this:-
ul#menu li {
width: 100%;
text-align: center;
margin-left: 0;
}
Use this in your css menu field:
float:right;

CSS hover effect that changes background color

I was hoping to find out how zazzle.com does their hover effect. I want to make an effect like that using pure CSS. I don't need the dropdown just the whole background of my element to change color.
CSS
/* the styles for the HTML elements */
html {
background: repeating-linear-gradient(#f3f3f3 0%,transparent 15%, transparent 90%,#000000 100% ),
url("../Images/bg.jpg") center center no-repeat;
background-size: cover;
height:135%;
}
body {
margin:0;
padding:0;
font-family: Arial, Helvetica, sans-serif;
}
footer{
clear: both;
margin-top: 1em;
padding-right: 1em;
border-top: 2px solid rgb(119, 75, 77);
}
footer p {
text-align: right;
font-size: 80%;
margin: 1em 0;
}
header{
width: 100%;
overflow: hidden;
height: 60px;
line-height: 60px;
position: relative;
background-color: #3a3a3a;
margin: 0;
}
#headerLeft{
width:50%;
float:left;
padding:0;
margin: 0;
}
#headerRight{
width: 50%;
float:left;
text-align: right;
padding:0;
margin: 0
}
li{
display: inline;
}
nav li:hover{
background-color: #ffffff;
}
.floatRight{
}
nav li{
margin: 0;
padding-bottom: .25em;
display: inline;
}
textarea {
width: 25em;
margin-bottom: .5em;
}
table {
border-collapse: collapse;
}
td, th {
margin: 0;
padding: .15em 0;
}
br {
clear: both;
}
/* the styles for the div tags that divide the page into sections */
#content {
float: left;
width: 580px;
padding-bottom: 1.5em;
}
#left_column {
float: left;
width: 150px;
padding-left: .5em;
}
#right_column {
float: left;
width: 300px;
padding-left: 1em;
}
#wrapper{
background-color: #ffffff;
opacity: .6;
margin: 0 auto;
padding: .5em 2em;
}
/********************************************************************
* styles for the classes
********************************************************************/
.right {
text-align: right;
}
.left {
text-align: left;
}
.cart_qty {
text-align: right;
width: 3em;
}
.button_form {
margin: 0;
padding: 0;
float: left;
}
.inline {
display: inline;
margin-left: .5em;
}
/********************************************************************
* Styles for the Product Manager application
********************************************************************/
#category_table form {
margin: 0;
}
#category_table td {
margin: 0;
padding: .15em .5em 0 0;
}
#add_category_form {
margin: 0;
}
#add_category_form input {
margin-right: .5em;
}
#add_admin_user_form label {
width: 8.5em;
}
#edit_and_delete_buttons {
margin-bottom: .5em;
}
#edit_and_delete_buttons form {
display: inline;
}
#image_manager input {
margin: .25em;
}
/********************************************************************
* Styles for the Product Catalog application
********************************************************************/
#product_image_column {
width: 8em;
text-align: center;
}
/*******************************************************************/
#add_to_cart_form {
margin: .25em;
}
#add_to_cart_form input {
float: none;
}
/*******************************************************************/
#cart {
margin: 0;
padding: 1em .25em;
border-collapse: collapse;
width: 100%;
}
#cart_header th {
border-bottom: 2px solid black;
}
#cart_footer td {
border-top: 2px solid black;
font-style: bold;
}
#cart td {
padding: .25em 0;
}
/*******************************************************************/
#login_form label {
width: 5em;
padding-right: 1em;
}
#login_form input[text] {
}
#payment_form label {
width: 8em;
padding-right: 1em;
}
#payment_form input[text] {
width: 5em;
margin: 0;
padding-right: 1em;
}
#add_category label {
text-align: left;
width: 3em;
}
#add_category input {
margin-right: .25em;
}
PHP PAGE
<?php
require_once('model/database.php');
require_once('model/category_db.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- the head section -->
<head>
<title>Willie's Fishing Supply</title>
<link rel="stylesheet" type="text/css"
href="<?php echo $app_path ?>main.css" />
</head>
<!-- the body section -->
<body>
<header>
<ul>
<section id="headerLeft">
<li>
<a href="<?php echo $app_path; ?>">
<h1>Willie's Fishing Supply</h1>
</a>
</li>
</section>
<section id="headerRight">
<?php
// Check if user is logged in and
// display appropriate account links
$account_url = $app_path . 'account';
$logout_url = $account_url . '?action=logout';
if (isset($_SESSION['user'])) :
?>
<li>
My Account
</li>
<li>
Logout
</li>
<?php else: ?>
<li>
Login/Register
</li>
<?php endif; ?>
<li>
Cart
</li>
</section>
</ul>
</header>
<nav>
<ul><?php
$categories = get_categories();
foreach($categories as $category) :
$name = $category['categoryName'];
$id = $category['categoryID'];
$url = $app_path . 'catalog?category_id=' . $id;
?>
<li>
<a href="<?php echo $url; ?>">
<?php echo $name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
<section id = "wrapper">
Try this css
.aj_R-departmentLinks > li:hover {
background: none repeat scroll 0 0 #FFFF00;
}
If you want to change background color on an element use the :hover selector
.element {
background-color: blue;
}
.element:hover {
background-color: red;
}

Unwanted space between divs

I am trying to get three images to connect for my content box but for some reason there is some space between the second and the third. Any help would be appreciated.
here is the site: http://hyvhuynh.com/hyperbolical-blog
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class();?> id="post-<?php the_ID();?>">
<div id="mythreedivs">
<div id="top">
</div>
<div id="mid">
<h2 class="post-title"><?php the_title(); ?></h2>
<ul class="meta">
<li><?php the_time('F j, Y'); ?></li>
</ul>
<div class="postcontent">
<?php the_content(the_title('', '', false)." - continue reading"); ?>
</div>
<ul class="meta postfoot">
<?php if('open' == $post->comment_status) : ?><li class="comment_link"><?php comments_popup_link('Comment on '.$post->post_title, '1 Comment on '.$post->post_title, '% Comments on '.$post->post_title,'postcomment','Comments are off for '.$post->post_title); ?></li><?php endif;?>
<?php if(get_the_tag_list()) :?>
<li>Tags: <?php the_tags('<ul><li>',',</li> <li>','</li></ul>');?></li>
<?php endif;?>
</ul>
</div>
<?php endwhile; ?>
<ul class="prevnext">
<li><?php next_posts_link('« Older Posts'); ?></li>
<li><?php previous_posts_link('Newer Posts »');?></li>
</ul>
<div id="bottom">
</div>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
---------css---------------
#mid {
background-image:url('http://hyvhuynh.com/wp-content/themes/zenlite/images/bodymiddle.png');
width:806px;
}
#bottom {
background-image:url('http://hyvhuynh.com/wp-content/themes/zenlite/images/bodybottom.png');
width:806px;
height:27px;
}
#header {
width:800px;
float:right;
margin:0 0 50px 0;
}
/*
Navigation Bar Time!
*/
#jsddm
{ margin: 20px 0 0 0;
padding: 0;
font-weight:bold;
text-shadow: #000000;
}
#jsddm li
{ float: left;
list-style: none;
font: bold 12px Tahoma, Arial}
#jsddm li a
{ display: block;
background: #E7E7EF;
padding: 5px 12px;
text-decoration: none;
border: 1px solid #555555;
width: 70px;
color:#000000;
white-space: nowrap}
#jsddm li a:hover
{ background: #1A4473}
#jsddm li ul
{ margin: 0;
padding: 0;
position: absolute;
visibility: hidden;
}
#jsddm li ul li
{ float: none;
display: inline}
#jsddm li ul li a
{ width: auto;
background: #E7E7EF}
#jsddm li ul li a:hover
{ background: #1A4473}
/*
End Navigation Time!
*/
.logo {
float:right;
}
#content .post {
float:left;
width:800px;
}
#content .page,#content .attachment,.postcontent {
width:800px;
text-decoration:none;
}
.photo {
width: 250px;
height:700px;
background-color:#000000;
margin:0 0 0 880px;
}
.slideshow { height: 232px; width: 232px; margin:0 0 0 880px; }
.slideshow img { border: 5px solid #000; }
.post-title {
margin:0;
padding:0;
text-align:center;
}
.post-title a {
text-decoration:none;
color:#000000;
}
.post-title a:hover,.post-title a:active,.post-title a:focus {
text-decoration:underline;
color:#5F625F;
}
#content .meta li,#content .prevnext li,#content .gallery li {
list-style-image:none;
list-style:none;
}
.meta {
margin:5px 0 0;
padding:0;
font-size:.85em;
}
.meta ul,.meta li {
margin:0;
padding:0;
}
.meta ul {
display:inline;
}
.meta li li {
display:inline;
padding-right:.3em;
}
.postfoot {
clear:both;
padding-bottom:10px;
line-height:1.2em;
}
.author .posts-by {
padding-top:10px;
}
.clearfix {
display: inline-block; }
.clearfix:after {
content: " ";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#footer {
clear:both;
margin:0 auto;
padding:0 0 5px;
text-align:center;
font-size:.8em;
border: 0;
width:800px;
height:200px;
}
#footer ul {
clear:both;
margin:0;
padding:0;
}
#footer li {
display:inline;
margin:0;
padding:0 5px;
}
#footer li.rss {
position:relative;
top:3px;
}
.copyright {
}
.copyright a
{
}
.copyright a:hover
{
}
.postcontent p {
text-decoration:none;
border:0;
border-style:none;
}
.postcontent p a:hover {
color:#fff;
}
The space is from the margin on your unordered list. Add this to your stylesheet
ul.prevnext {margin: 0px;}
And it'll correct it. I'm not sure what you're doing with it though, so you may want to just scrap it for now because once you add any items, it will pop up again. Or move it to a different position as mltsteeves mentioned.
<ul class="prevnext"> is causing the space between the two divs, try putting it inside the previous div.
You have nesting errors in your markup. I would sort them out first, from what I can see in Firebug, it might already sort it out.
end tag for "div" omitted, but OMITTAG NO was specified
end tag for "ul" which is not finished
The block below:
<ul class="prevnext">
<li></li>
<li></li>
</ul>
is not contained inside the proper <div> tag, it is between your mid and bottom divs.

Categories