Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stylesheets for content?

Forgive my ignorance since this seems like its something I should know by now.

I know I could make a stylesheet that will allow me to make changes in my CSS throughout several pages that use the CSS. I also know that you can make an external javascript file that could contain functions you want to reuse. But lets say I had pure HTML content (lets pretend a bunch of buttons or links) that I wanted replicated on several pages. Is there anything similar to a stylesheet in that regard? This would allow you to update the buttons/links all at once.

like image 325
tom Avatar asked Jun 22 '10 19:06

tom


People also ask

What are the 3 types of CSS?

There are three types of CSS which are given below: Inline CSS. Internal or Embedded CSS. External CSS.

How do you give a content URL in CSS?

url() The url() CSS function is used to include a file. The parameter is an absolute URL, a relative URL, a blob URL, or a data URL. The url() function can be passed as a parameter of another CSS functions, like the attr() function.

What is content in SCSS?

The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.

What is the use of stylesheet?

A style sheet is a file which tells a browser how to render a page. There are even aural style sheets [coming up -1997] for telling a speech browser how to pronounce different tags. A current recommendation for style sheets is the "Cascading Style Sheets" (CSS) language.


1 Answers

Try server-side includes.

The most frequent use of SSI is to include the contents of one or more files into a web page on a web server. For example, a web page containing a daily quote could include the quote by placing the following code into the file of the web page:

You could also use PHP, if your host allows it. Just change the name of the page from .html to .php and reference the header:

<?php include "header.php" ?>

Both of these require you to change the file's extension, so you might also want to use mod_rewrite to let users still access it via the .html name. Again, if your host supports it.

like image 150
Gelatin Avatar answered Sep 21 '22 07:09

Gelatin