Links no more clickable after moving <?include .. .php")?> above main <div> in PHP file

StackOverflow https://stackoverflow.com/questions/22867809

  •  27-06-2023
  •  | 
  •  

문제

Would anyone have some clue on this issue I cannot manage to find a fix for: On homepage www.vertu-approved.fr none of the links in the left menu are working after I made the following small change in the website home.php file:

BEFORE:

<body>
<div id="main_container">
<? include ("media/includes/header.php")?>
<?include ("media/includes/leftmenu2.php")?>    

AFTER:

 <body>
 <?include ("media/includes/leftmenu2.php")?>   
 <div id="main_container">
 <? include ("media/includes/header.php")?>

Since I moved <?include ("media/includes/leftmenu2.php")?> above the <div id="main_container"> all links in the leftmenu2 have stopped working.

The issue is happening in Safari, Firefox and Chrome.

  • So far I have verified in both home.php and leftmenu2.php that all <div> have an associated closing </div> tag positioned at the right place. Ps. Quite surprisingly if I intentionally remove the final closing </div> in leftmenu2.php it makes the links clickable again (but messes out the whole page page structure & formatting).

  • I have read that the issue may be caused because home.php is at the website root directory while leftmenu2.php is located in a sub folder. However leftmenu2.php path i.e. media/includes/leftmenu2.php appears fine to me, and with this same path things were working fine before I made that initial small change.

How can I get the links to be clickable again while keeping leftmenu2.php outside the <div id="main_container">?

Many thanks

도움이 되었습니까?

해결책

Add this rule to #middleleft_pan in your stylesheet (style.css line number 135),

#middleleft_pan{
position: relative;
z-index: 2;
}

Explanation: I see a <div> with ID main_container which is stacking above your menu. So your menu does not get the mouse over.

다른 팁

Header must be placed top of all, or deplace the HTML code that you need from header to leftmenu2.php

Because there a PHP codes that you placed on header and leftmenu2.php need them.

your #main_container is appearing over the top of the menu

add:

z-index: -1;

to #main_container in your css file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top