LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-30-2014, 10:32 AM   #1
yawningdog
LQ Newbie
 
Registered: Sep 2009
Posts: 19

Rep: Reputation: 0
HTML/CSS noob question


I want to add a link at the bottom of my website, but my website has several pages. How can I add this link to the bottom of all the pages without having to edit each one individually? Is there a way to do this in the liked stylesheet?
 
Old 06-30-2014, 10:53 AM   #2
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
I'd generate the HTML pages instead (or go over them all with AWK before publishing), but maybe you can use :after. I'm not sure you can have a link in :after though.
 
Old 06-30-2014, 04:14 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
You have to edit each one individually, if they're just HTML and CSS.

This is one reason "server pages" (including CMS systems such as Wordpress) are universal.
 
Old 06-30-2014, 04:35 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
You could also use PHP 'include' command (to include code snippets in all your pages. Possibly you'd have to enable PHP support (if it isn't already enabled).
 
Old 07-01-2014, 01:46 AM   #5
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
You could also use PHP 'include' command (to include code snippets in all your pages. Possibly you'd have to enable PHP support (if it isn't already enabled).
OR "include" it as a <script=javascript src="common.js"> by surrounding the link line with document.write(" and "); pair if you don't want to enable server support. ie. simple static web page. Of course don't forget to escape double quotes or use single quotes.

OK

Last edited by AnanthaP; 07-01-2014 at 01:48 AM.
 
Old 07-01-2014, 11:39 AM   #6
yawningdog
LQ Newbie
 
Registered: Sep 2009
Posts: 19

Original Poster
Rep: Reputation: 0
I went with the PHP "include" solution. It works great, thanks. Although the concept of generating content is attractive and I would like to give it a try, it sounds a little too daunting for a noob like me. If you care to suggest a resource for learning this type of thing, I would love to see it.

If you want to see the site, it's yawningdogge.com. But do bear in mind it's not meant to actually be good, it's really just a lab environment for learning web stuff.
 
Old 07-01-2014, 12:33 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by yawningdog View Post
Although the concept of generating content is attractive and I would like to give it a try, it sounds a little too daunting for a noob like me. If you care to suggest a resource for learning this type of thing, I would love to see it.
You'd typically either install software (such as Wordpress) that does it for you. With Wordpress you just install it, create an account, and optionally create a "theme" make it look like anything you want. Then you log into the account, and you create your content the way you create posts on this forum.

The theme can automatically add a footer to each page, for example.
 
Old 07-01-2014, 01:40 PM   #8
yawningdog
LQ Newbie
 
Registered: Sep 2009
Posts: 19

Original Poster
Rep: Reputation: 0
My wife took that approach to her website with tepid results. She tried wordpress for a while but finally settled on wix.com which she really likes. They are both valid ways to get a website up and working, but I don't really think they are a good way to really get into the nuts and bolts of web development which is what I'm trying to do. I personally found wordpress to be user-hostile to the point that learning HTML, CSS, PHP and cgi seemed a lot easier and more fun.
 
Old 07-01-2014, 02:30 PM   #9
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Well, if you're starting with web development you do need to get to know what websites are made of (ie. html, css, js or php on the server side). Then however, once you have some knowledge of them, you probably would like to start using a CMS (Wordpress, Drupal) or a web framework to develop your websites/web applications. Once you know how to write templates in eg. Wordpress, you'll be WAY more efficient using their platform with all its functionality than writing everything from scratch.


At the beginning you can develop things manually, later on, as your projects get more complex, it won't be a feasible or even sensible option.


For CSS I'd recommend starting each project with Sass straight away.

Last edited by sycamorex; 07-01-2014 at 02:31 PM.
 
  


Reply



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
CSS - Is there a way to put several lines of HTML into one line using CSS? Chronothread Programming 12 01-05-2011 06:06 AM
html/css question _john_i_ Programming 2 09-08-2008 03:04 PM
CSS/HTML/PHP/OBJECT Question br00tal Programming 3 04-10-2008 10:37 PM
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration