0

Hi,
I am working on a website and I am having trouble with the index bar. Perhaps this is the way it's supposed to be but I though a PHP meant only having to have one file for all the pages. So,

When I click to a link that gets me to a page inside a folder, the page opens but the menu will not contain the CSS style. Only the raw links.

So I noticed if I include the menu_bar.php inside that folder it will show perfectly with CSS. But now, if I add a new link, I also have to modify the copy of menu_bar.php inside each folder.

I was thinking there may be a problem importing the CSS but not sure what's going on.

bottom line, bar_menu.php will execute CSS in any page in the main HTML directory, but when going to a page that is inside a folder, CSS disappears.

Any ideas?!

Thank you!

4
Contributors
7
Replies
9
Views
6 Years
Discussion Span
Last Post by diafol
0

Do you have a relative referenced CSS file?
If so, perhaps making it absolute referenced will help:

href="/css/main.css" instead of "css/main.css"

0

Can you tell me how should it go here?
this is what I got currently

type="text/css">@import url('href="menu/menu_style.css"');</style

0

Do you have a relative referenced CSS file?
If so, perhaps making it absolute referenced will help:

href="/css/main.css" instead of "css/main.css"

Can you tell me how should it go here?
this is what I got currently

type="text/css">@import url('menu/menu_style.css"');</style

Thank you!

Edited by manchurianCEO: n/a

1

this type="text/css">@import url('menu/menu_style.css"');</style means load the css file inside the menu subfolder of the current folder
doesnt work when you are in a subfolder because the menu folder is no longer a subfolder

<style type="text/css">@import url('/menu/menu_style.css"');</style> 
<style type="text/css">@import url('http://www.yoursite.com/menu/menu_style.css');</style>
<style type="text/css">@import url("<?php echo $_server['document_root']; ?>/menu/menu_style.css");</style>
<link rel="stylesheet" type="text/css" href="http://www.yoursite.com/menu/menu_style.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_server['document_root']; ?>/menu/menu_style.css">
<link rel="stylesheet" type="text/css" href="/menu/menu_style.css">

all work
take your pick

Edited by almostbob: n/a

0

Awesome! thank you

this type="text/css">@import url('menu/menu_style.css"');</style means load the css file inside the menu subfolder of the current folder
doesnt work when you are in a subfolder because the menu folder is no longer a subfolder

<style type="text/css">@import url('/menu/menu_style.css"');</style> 
<style type="text/css">@import url('http://www.yoursite.com/menu/menu_style.css');</style>
<style type="text/css">@import url("<?php echo $_server['document_root']; ?>/menu/menu_style.css");</style>
<link rel="stylesheet" type="text/css" href="http://www.yoursite.com/menu/menu_style.css">,
<link rel="stylesheet" type="text/css" href="<?php echo $_server['document_root']; ?>/menu/menu_style.css">
<link rel="stylesheet" type="text/css" href="/menu/menu_style.css">

all work
take your pick

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.