- This topic is empty.
October 16, 2018 at 9:34 am #277701
Thanks to help from this forum, I have a navigation menu. What I want now is to have that navbar on every html page without of course having to copy and paste the contents into the page. I basically have this:
Then I have some ul and li elements with the links to the pages. I have been searching online, but I’m getting too many different answers. I want this all done via HTML and/or CSS, if possible. I’m not an expert in either, but I can follow instructions.
My plan is that one page is the navbar, with only the bar in the tag. Then of course, I’ll point to that navbar on every page, where I’ll then also have my content.
I just need to know how to link the navbar to every page. I can give more details, I was trying to be brief.October 16, 2018 at 10:41 am #277703
The most basic HTML and CSS approach I think would be an iframe – navigation in the main page (targeting the iframe) and then have individual content/pages displayed through the (named) iframe.
I wouldn’t use it at all if I could help it, and if I absolutely had to, I would only suggest using it on the most simple of websites (5 or so pages).
If you want to research more and see if this works for you, try Googling something like “named iframes and linking to them with the target attribute”.
If you need further help, try putting together a simple CodePen showing what you’ve tried and what problems you’re having. Also clearly explain what the disirable outcome is versus what is actually happening so that we can offer suggestions for a fix.October 16, 2018 at 11:05 am #277704
Yes – Default iframes can look horrible, but you can remove the border and/or scrollbar to give them a much nicer, integrated appearance.October 16, 2018 at 2:26 pm #277710
That’s the actual menu that I want to have on every page, since every page will have a report attached to it.
Thank you for any help.October 16, 2018 at 9:54 pm #277765
Sorry – The menu markup can’t go in the head element. It should go in the body element, along with the iframe through which to view other pages/content.
I would still say to use server-side solutions like PHP, which can be made to run in standard .html/.htm pages IF the server is setup to parse PHP in .html/.htm. You can do this through .htaccess. Just something else to consider.October 18, 2018 at 10:15 am #277830
Thank you for all your help.
- The forum ‘Design’ is closed to new topics and replies.