Get style sheets to work in the header.php and associated files

Let's say I created a file header.php in my includes folder.  And I include in my index.php file in the root directory of the site.

Then in the header.php file, I have a link to the style sheet.

The question that I've always found is that you can't get the header.php file to apply the style sheet.

I can operate using global links, however I don't want to do that I have to cancel them before I have download site.  (And I forgot...)

Anyway, I came up with this code today to try to solve this problem.  Here is my header up to now file:

"; } else echo ' ';? >

Here is what it does:

1. we create a variable called $directory that corresponds to the current directory.

2. then what it will create another variable called $currentFolder which is equal to, or not the variable $directory contains the word "includes".

3 then he said: If $currentFolder is true, then it has the location of the style sheet with respect to the header.php file.

4. other - if it IS false then the style sheet is located in a location with regard to the files in my root directory.

This works perfectly well... in Live view mode.  The header.php and index.php formats the header using live view.  Nor will however be the format in Design view.  That sucks cause I was pretty happy that I came up with this code on my own.

The reason why it is not working in Design view - I realize now--is because Dreamweaver will not deal with this script in Design view.

Does anyone know how to get this script to run in design mode?  Or maybe some suggestions on modifying this code to run in design mode?

Thank you!

> The question that I've always found is that you can't get the header.php file to apply the style sheet.

Right. This is because, it seems that you already understand this, the relative location of the css file is different from the point of view of the header file and the file parent. Because the header file is included in the parent on the server, the client then sees the css file in the wrong place.

The solution is to use stylesheets for the time Design. It will be worth the css of the page at design time only - it will not actually insert the css file in the code. So, insert the reference of css in the header of the point of view of the parent file - index.html. Then add a design time style sheet. It should work.

Tags: Dreamweaver

Similar Questions

Maybe you are looking for

  • Re: Satellite L655-11N - Webcam does not appear on the video chat

    Hello, recently I had a problem with my webcam on Toshiba L655-11NIt worked perfectly when I chat with my friends on Facebook, Yahoo, Skype But now I can see my friends, but they cannot see me, even the webcam does not appear on my screen even though

  • HP Color LaserJet 2605dn

    I have a HP Color LaserJet 2605dn. It worked very well with the Microsoft Vista operating system. I just bought a computer with operating system Windows 8 home and now my printer won't do the double sided printed (not the manual double-sided, but pri

  • loaded Windows 7 and now my online games continue to be disconnected___

    loaded Windows 7 and now my games online keep get disconnected. they remain connected for only a minute. I've updated all the drivers and windows.

  • Laptop 15-R205TU: broken hinges and must be replaced

    Hello I bought this laptop only 4 months ago and its left hinges broke because he has not escaped or hit anywhere. I called the customer service and told them that when I opened the lid on normal use it is broken, which is quite shocking to me. They

  • Cancel a prior payment posted/treaties

    R12.1.2Dear Oracle gurus,I have a requirement to cancel a cheque that has been treated in NOV-2013-2015. Payments have been processed and ancient periods are closed.Please notify.Thank you-Vincent