kade119 Posted May 18, 2011 Share Posted May 18, 2011 So say i have this: <link rel="stylesheet" media="all" type="text/css" href="_css/styles.css" /> now the file that is linking to that is 3 directories deep, besides using a rel or absolute link, could i define the path by using something like this <link rel="stylesheet" href="<?php require($_SERVER['DOCUMENT_ROOT'] . "/_css/portfolio-styles.css"); ?>" type="text/css" /> but this is actually opening the CSS in the header thanks for any explanation on how to do this Quote Link to comment https://forums.phpfreaks.com/topic/236805-nub-question-dynamically-link-header-files/ Share on other sites More sharing options...
btherl Posted May 19, 2011 Share Posted May 19, 2011 It's the require() that is making the css appear directly in your html. Does it work if you just use "/_css/portfolio-styles.css" as the href? No PHP code should be needed there, just HTML Quote Link to comment https://forums.phpfreaks.com/topic/236805-nub-question-dynamically-link-header-files/#findComment-1217327 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.