summersurfer Posted January 2, 2008 Share Posted January 2, 2008 Hello Everyone, I am working on a website with several hundred pages. The way some pages are displayed is as follows: <body> <?php require_once('header.php'); require_once($_GET['pageId']); require_once('footer.php'); ?> </body> This works fine. But in the footer page I have some styles set like the following: <style> a:link { font:Arial, Helvetica, sans-serif; text-decoration:none; font-size:12px; color:#FFFFFF; } </style> For some reason, this footer page is overwriting the global css file that the main page uses. Is there some way to keep the style for the footer controlling only the footer and not have it change the middle page that the php is loading? I am guessing the reason this is happening is because the footer is loaded once and then all its formatting is overwriting the middle php page as it is reloaded. I know this sounds really confusing but hopefully someone can make sense of it. I want the footer styles to stop chaning the other php pages. Quote Link to comment https://forums.phpfreaks.com/topic/84050-styles-carrying-over-through-php-pages/ Share on other sites More sharing options...
kratsg Posted January 2, 2008 Share Posted January 2, 2008 This is kinda an html/css question, not really php. Here's what you need to do, all the links that you need changed in the footer, give them class="footer" Then in your global style, add a link of this type: a:link.footer { font:Arial, Helvetica, sans-serif; text-decoration:none; font-size:12px; color:#FFFFFF; } This will affect all links of the class "footer" and not all links (don't forget to put this below all the global css styles) Quote Link to comment https://forums.phpfreaks.com/topic/84050-styles-carrying-over-through-php-pages/#findComment-427811 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.