Hello,

Is it possible to create a menu template in CSS? I thought only style code could be put in the CSS, but a friend says that I could create a menu template using CSS.

The menu would have 2 horizontal lines at the top for choices and there would be a medium notes/new section on the far right and an area for PHP code output in the remaining area.


I know this PHP part, should be asked in another area, but I am asking it here because it goes with this (sorry). When the user selects a menu choice from one of the 2 menu bars, I need the PHP to direct the output to the large area, is that possible in conjunction with this being done using CSS?

example:
-------------------------------------------------------------------
-------------------------------------------------------------------
-------------------------------------------------------------------
| |
| |
| |

Member Avatar for GreenDay2001

Didnt understood your problem well.

Is it possible to create a menu template in CSS?

Well, i suppose u r referring to external css files, since it could be used by several files and one change in that file would be affected to all pages, so its a template.

I know this PHP part, should be asked in another area, but I am asking it here because it goes with this (sorry). When the user selects a menu choice from one of the 2 menu bars, I need the PHP to direct the output to the large area, is that possible in conjunction with this being done using CSS?

I didnt understood this problem well, but i think it's possible....(as an inference to what i have understood :))

you can't create objects/elements in CSS. you can layout objects and elements, and describe their properties to a certain extent. You would still need HTML objects to hold the parts of the menu (the menu hyperlinks,graphics,etc). The CSS could be used to arrange these elements in a menu-like fashion.

If you're using PHP, avoid creating one huge PHP file that inserts a HTML page into the middle. Create one tiny PHP file that inserts a number of HTML fragments. It's messy, but faster than (hyper)text processing a long file. You could do that a number of ways.

Ideally, don't use PHP atall. Serve well organised, automatically constructed HTML if you want to create a consistant look and feel. There's certain situations where that isn't appropriate, but unless your page content is going to change at a daily (or higher) frequency and be based on user input; you shouldn't ever need to process entire pages on-demand at the server.

In some "benchmark tests", I found that just renaming an index.html file to index.php made it load over 5 times slower. I didn't use a stopwatch, but it was very clearly visible.

Member Avatar for GreenDay2001

Oh, so was he planning to use css without html?? I think now i am understanding his problem. . . . . :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.