Trying to apply a master page (or something like it) with css?

Discussion in 'HTML & Website Design' started by cscott5288, May 5, 2008.

  1. #1
    I am using just plain old notepad (not wordpress, frontpage, dreamweaver) and external css sheets for all of my coding on my website www.webtemplex.com but ive run into a problem. im trying to get it so that when i change one thing in the menu (for example the Over 500 Free Templates: template categories) it will apply to all of my pages. I know that i can us external css sheets to apply fonts and styles to text but can i use it to actualy insert/change text aswell?

    thanks ahead
     
    cscott5288, May 5, 2008 IP
  2. Aaron700

    Aaron700 Active Member

    Messages:
    338
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    you could use PHP like where you want your content use
    
    <?php
    include 'content.html';
    ?>
    
    Code (markup):
    and then create content.html like

    
    Welcome<br>
    Welcome
    
    Code (markup):
    Hope this is what you ment
     
    Aaron700, May 5, 2008 IP
  3. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    ok ive tried the php thing its not working for me


    is there any way i can do this with css??
     
    cscott5288, May 5, 2008 IP
  4. sentuken

    sentuken Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    CSS only changes properties, not the actual content. You can either do this with XML or PHP, like Aaron700 explained.
     
    sentuken, May 5, 2008 IP
  5. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    ok, i tried doing what aaron 700 sugested.

    i saved a seperate html file with the content i wanted to insert and then saved it as content.html

    then, where i wanted the content on my page i put <?php include 'content.html';?>

    with no suprise the content didnt show up in my page

    am i missing something? on the content.html page do i only put the content i want in or something else as well (my instinct tells me something else has to be there within reference to the php)

    please explain like im a complete beginner (i am to php, xml)
     
    cscott5288, May 5, 2008 IP
  6. HDaddy

    HDaddy Active Member

    Messages:
    287
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #6
    I think it should be content.php as you are using php commands. And all the other pages should be .php also.
     
    HDaddy, May 5, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well, you can't only just say <?php blah blah because that's just referring to the php script, which you don't have. People use stuff like Wordpress because it comes with the scripts too, not that you can't get them seperately. PHP, Perl, Python, any decent object oriented scripting (rather than compiled) language should be able to do the job-- which is to look in the database (or in this case, just your server) and fetch the files you call. (note, I'm not saying PHP is a decent language, only a popular one... not yet at least. It lets you write total crap without giving enough errors... we can hope PHP6 fixes this)

    ...And that's about all I know about PHP etc, because on a UNIX system you can use sed to find and replace stuff in a whole heap of files pretty fast, and any sites I've written which were too big for that were thrown in a Perl or PHP template and uses CMS (Content Management System) anyway by someone else (a programmer).

    You can, though not in the way you mean, and not for IE6. But there is a CSS method to add generated content (not generated from some other file but already sitting in your CSS all the time) using :before and :after css pseudo classes. Most commonly used to clear floats using the PIE method (adding a . as content to clear a float).
     
    Stomme poes, May 6, 2008 IP
  8. dgxshiny

    dgxshiny Greenhorn

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    23
    #8
    You can do an HTML include

    <!--#include virtual="insertthisfile.html" --> 
    Code (markup):
     
    dgxshiny, May 6, 2008 IP