CSS - Is there a way to put several lines of HTML into one line using CSS?
I've got a website set up which has a section which is just a bunch of links on the side. But this section of links is on every page of the website. And when I expand and add more links I don't want to have to go to every page and add the new link. Is there a way that I could put all the links into something on CSS (or anything else) that I could just include one line in the HTML? So that when I add a link I'll only have to edit the one file and and then every page will be updated?
Thanks for your time. |
You cannot do this with CSS as it is not designed for content. You can use either webserver technology such as SSI or something dynamic like JSP includes.
If you want to stick with something more static, then JavaScript is probably your only option. Personally, I would go with something more dynamic. |
Ignore, I had not noticed that your content appears to consist of hyperlinks...
|
Thanks for the quick reply.
And there's no way I can just have a separate HTML file that I could somehow call or something from another HTML file? And it would just include whatever is in the called HTML file where it's "called" at? I'm using space provided to me by the University I'm attending and I don't believe they allow for SSI. Thanks for your help. |
Quote:
You can use an IFRAME, but this is not supported by XHTML 1.0 or HTML 4.1 Strict. |
Ok, I'll see what I can do then.
Thanks much for the information. |
I'd just use php for this. Maybe your server supports that (most do nowadays). You can create a separate php file with the menu, or whatever, then just include it from your main php file(s).
|
Quote:
background-image: url(/resources/pictures/35663ai.gif); |
I'd just use a content management system for this. That's what they're for. I recommend Wordpress.
If you can't install a CMS, then an alternative is to use a templating engine: http://wiki.python.org/moin/Templating Here's one popular templating engine you can use: http://www.makotemplates.org/ |
OP ...
Silly question - are you just trying to keep a navigation section on the page at all times? If so, that can certainly be achieved w/ css and a plain (single) HTML file. Cheers, Tink |
*sigh*
another network induced axidupe :/ |
Quote:
On a side note: i 'm not using php (cuz I haven't leaned it yet) so I'm tryna figure out if I can use js to call the navigation and have it edit the code based on what page is loading. I guess something like: if - <ttitle> ="x" then = doc.write. etc etc get it? And how do most major websites keep the navi with the other pages? (If I said that correctly) |
I did a similar thing by making a quick templating tool in perl and make
which generates a website from templates. I stuck my menu and logo on every page. there may be proper tools to do this. you can do it with js yes. there are plenty of free CSS menu and js menu sites out there. try cssplay. a lot of CMS tools need an RDBMS as well, which may or may not be available on your host. you could try SSI maybe? |
All times are GMT -5. The time now is 06:26 AM. |