php - Load CSS file from a header used in many pages -
i used create unique header , load in pages this.
<?php require_once('include/_header.php'); ?> <div id="main"> <!-- page --> </div> <? require_once('include/_footer.php'); ?>
in root folder have folder named css put css stylesheets in header call <link rel="stylesheet" href="css/style.css" type="text/css">
. now, suppose have create subfolder inside root , create web page it. when call stylesheets header, page doesn't show correctly, because call stylesheet in wrong way. how can call stylesheet in way can reachable position?
here schema:
css -style.css include -_header.php -_footer.php folder -mypage.php
use absolute path:
<link rel="stylesheet" href="/css/style.css" type="text/css">
(note slash before css directory)
Comments
Post a Comment