Jump to content

embedding html, text in CSS?


zuludigital

Recommended Posts

I have hundreds and hundreds of identical html photo pages that would be a time consuming to update with my name and a link - which i want to do. The pages all use the same css file. So my question is - can i embed text and a link into the ccs file. I suppose another alternative is to find a program can go into a group of identical files and insert my desire code in one swoop. But I don't know what (free?) program that might be.

Link to comment
Share on other sites

Why not use a server-side language such as PHP to create a generic page and then include the dynamic information via the include construct?

Link to comment
Share on other sites

I do not know how to do what you suggest but if I need to go this kind of route I will. I am curious about the answer to my css question too.

Why not use a server-side language such as PHP to create a generic page and then include the dynamic information via the include construct?
Link to comment
Share on other sites

Oh - well, you can embed text, sort of, through the content: property

element:before {	content:"This text will appear before the element";}

But tags won't be parsed.If you want to use PHP, read the PHP tutorial: http://www.w3schools.com/php/ and the PHP website: http://www.php.net/

Link to comment
Share on other sites

  • 2 weeks later...

Well I avoided PHP - for now and did use a mutlifile editor: "Text Replacer" freeware if anyone's interested.

Synook is right. In this case, PHP would probably be the best route to go. But make sure the server you're working on has PHP installed on it.
Link to comment
Share on other sites

Hello,The best way to do it and without using PHP is with a simple include (also called Server Side Include or SSI):<!--#include file="file.html" -->The advantage of using an include is that if you need to edit the information on it you just open that file, edit it, and upload it = Voilá! All your files are now updated. No need to use "Text Replacer" again."Text Replacer" seems to be a very powerful tool though, thanks for the info :)--The problem with the Synook's CSS pseudo-element suggestion is that it doesn't work on IE6... unless you are not considering this browser for your design (which would be very wrong, IE6 is still being VERY used out there), then you're good with Synook's suggestion.Here's a list of CSS pseudo-elements that IE6 has issues with or just plainly doesn't support them (IE6 has incomplete CSS 2.1 support):

  • * Child selectors * Adjacent sibling selectors * Attribute selectors * Multiple class selectors * The :first-child pseudo-class * The language pseudo-class * The :before and :after pseudo-elements * The :hover pseudo-class only works on a elements * The :focus pseudo-class isn’t supported. For a elements that have focus, the :active pseudo-class is applied.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...