html - css not working when header.php file included in other than root folder but working on root folder -
i have index.php file on root folder , has header file included like
include 'include/header.php';
in header.php have next code @ start...
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <title>title</title> <link rel="stylesheet" href="./css/main.css" type="text/css" /> <link rel="stylesheet" href="./css/dashboard.css" type="text/css" /> <script src="/js/jquery-1.10.2.js"></script> <script src="/js/bootstrap.js"></script> <script src="/js/tablesorter/jquery.tablesorter.js"></script> <script src="/js/tablesorter/tables.js"></script> </head> <body>
the above index.php working fine on root folder when utilize in other folder css not working same file... if utilize abc/index.php css not work file...
note : have used ./ / or nil @ not working.
you can utilize base tag , alter code this
<base href="http://localhost/abc/" /> <link rel="stylesheet" href="css/main.css" type="text/css" /> <link rel="stylesheet" href="css/dashboard.css" type="text/css" /> <script src="js/jquery-1.10.2.js"></script> <script src="js/bootstrap.js"></script> <script src="js/tablesorter/jquery.tablesorter.js"></script> <script src="js/tablesorter/tables.js"></script>
php html css
No comments:
Post a Comment