LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-14-2008, 02:03 PM   #1
Chronothread
Member
 
Registered: Apr 2007
Posts: 121

Rep: Reputation: 15
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.
 
Old 12-14-2008, 02:16 PM   #2
jcookeman
Member
 
Registered: Jul 2003
Location: London, UK
Distribution: FreeBSD, OpenSuse, Ubuntu, RHEL
Posts: 417

Rep: Reputation: 33
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.
 
Old 12-14-2008, 02:32 PM   #3
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Ignore, I had not noticed that your content appears to consist of hyperlinks...

Last edited by jay73; 12-14-2008 at 02:37 PM.
 
Old 12-14-2008, 02:36 PM   #4
Chronothread
Member
 
Registered: Apr 2007
Posts: 121

Original Poster
Rep: Reputation: 15
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.
 
Old 12-14-2008, 02:47 PM   #5
jcookeman
Member
 
Registered: Jul 2003
Location: London, UK
Distribution: FreeBSD, OpenSuse, Ubuntu, RHEL
Posts: 417

Rep: Reputation: 33
Quote:
Originally Posted by Chronothread View Post
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.
CSS is used by the client to define the presentation of the content. In order to actively change the content, you will have to use server side technology. You can use a dynamic menu written in JavaScript, but this is client-side technology.

You can use an IFRAME, but this is not supported by XHTML 1.0 or HTML 4.1 Strict.
 
Old 12-14-2008, 03:17 PM   #6
Chronothread
Member
 
Registered: Apr 2007
Posts: 121

Original Poster
Rep: Reputation: 15
Ok, I'll see what I can do then.

Thanks much for the information.
 
Old 12-14-2008, 05:13 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
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).
 
Old 01-04-2011, 05:38 PM   #8
addic
Member
 
Registered: Nov 2010
Posts: 30

Rep: Reputation: 0
Quote:
Originally Posted by Chronothread View Post
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.
i'm thinking...and this hasn't been tested..but uh did you try using the bg image tag to call the file? it looks something like this in the css script...

background-image: url(/resources/pictures/35663ai.gif);
 
Old 01-04-2011, 05:43 PM   #9
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,562

Rep: Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394Reputation: 1394
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/

Last edited by dugan; 01-04-2011 at 06:13 PM.
 
Old 01-04-2011, 06:04 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,964
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
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
 
Old 01-04-2011, 06:04 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,964
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
*sigh*
another network induced axidupe :/

Last edited by Tinkster; 01-04-2011 at 06:05 PM. Reason: axidupe content removed
 
Old 01-05-2011, 05:33 AM   #12
addic
Member
 
Registered: Nov 2010
Posts: 30

Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
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
I'm not sure about chondeau but, me, ironicly yeah, but the problem isn't seperating the code its re-implimenting it into the file...should we do it your way, which sounds good, what's the line to throw it back into the given webpage.

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)
 
Old 01-05-2011, 06:06 AM   #13
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,282

Rep: Reputation: 172Reputation: 172
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to print a html file with css from command line? Lokiji Linux - Software 4 09-17-2007 03:42 AM
HTML/CSS/JS: Problem with <p> not having an absolute position with CSS. RHLinuxGUY Programming 7 03-03-2007 12:21 AM
A little HTML/CSS help? jon_k General 9 07-17-2005 01:49 AM
html/css retrodict Programming 5 11-01-2004 06:56 PM
html/css hylke Programming 0 06-27-2004 02:39 PM


All times are GMT -5. The time now is 12:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration