rkolinsky Posted November 13, 2009 Share Posted November 13, 2009 I am using the following code for a navigation bar. How do I change the size and color of the font. I am very new to php. $page = end(explode('/',$_SERVER["SCRIPT_NAME"])); #This gets the current page's name. if ($page == "index.php") #Just test the page's name print('<span style="currentpage; >Panama Homepage</span>'); #And print the 'you're here' HTML else print('<a href="index.php">Panama Homepage</a>'); #Or, the 'you're not here' HTML print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; if ($page == "contact.php") print('<span style="currentpage">Contact Us</span>'); else print('<a href="contact.php"text-decoration:none;>Contact Us</a>'); print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; if ($page == "kunayala.php") print('<span style="currentpage">Kuna Yala</span>'); else print('<a href="kunayala.php">Kuna Yala</a>'); print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print '<br>'; Link to comment https://forums.phpfreaks.com/topic/181349-help-with-php-include-file/ Share on other sites More sharing options...
Szandor Posted November 13, 2009 Share Posted November 13, 2009 You should use CSS for that, not PHP. Add a class or an ID to the elements you want to change the font for and use a CSS-file to style it. Link to comment https://forums.phpfreaks.com/topic/181349-help-with-php-include-file/#findComment-956659 Share on other sites More sharing options...
rkolinsky Posted November 13, 2009 Author Share Posted November 13, 2009 The reason I am using a php include is that it will be a lot easier to add a new link if necessary. Then, I won't have to add it to each page, just the php file. Does that make sense? Link to comment https://forums.phpfreaks.com/topic/181349-help-with-php-include-file/#findComment-956660 Share on other sites More sharing options...
The Little Guy Posted November 13, 2009 Share Posted November 13, 2009 give the tag a class atribute, like: class="navItem" then in css: .navItem{ color: #FF0000; font-size: 14px; } Link to comment https://forums.phpfreaks.com/topic/181349-help-with-php-include-file/#findComment-956663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.