SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External stylesheets and logos???

    Hi. I'm very new to CSS, and this will probably be a stupid question to all of
    you, but here goes anyway.
    I need to put 3 logos at the bottom if every page on site, and was wondering
    if it would be possible to do this with the use of an external stylesheet?

    Any help or advice would be much appreciated.

    Many thanks

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it's possible, but it's not really a good idea. It is incompatible with most browsers and is a hack.

    If you are wondering how, try this code.

    Code:
    div.bottompart:after {
      content: "<img src='hello.jpg' /><img src='hi.jpg' /><img src='welcome.gif' />";
    }
    ...where #bottompart is the thing that you want to be right above the images.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Best thing to do would be to use some sort of server side processing such as PHP, SSI or ColdFusion. It would simply work like this:

    PHP:
    <?php include("somefile.html"); ?>

    SSI (Server-sude includes):
    <!--#virtual file="somefile.html" -->

    ColdFusion:
    <cfinclude template="somefile.html">

    Where "somefile.html" included the following code:
    <img src='hello.jpg' /><img src='hi.jpg' /><img src='welcome.gif' />
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    creole, which is better...to include the php code in all pages or just put the images in every page [and of course, forget the php code]?

    My main concern here is loading time. Any thoughts?

  5. #5
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Putting the PHP code at the bottom of the page would result in exactly the same loading speed as pasting the image HTML in at the bottom of every page, as the PHP code is interpreted by the server before the page is sent to the client so the client would end up recieving exactly the same HTML anyway.

    You can keep your three logos in a style sheet by using this code at the bottom of each page:
    Code:
    <div id="logo1"></div><div id="logo2"></div><div id="logo3"></div>
    And then using the following code in your external stylesheet:
    Code:
    #logo1 {
      background-image: url("logo1.gif");
      height: 50px;  /* Set to height of logo1.gif in pixels */
      width: 50px;   /* Set to width of logo1.gif in pixels */
    }
    #logo2 {
      background-image: url("logo2.gif");
      height: 50px;  /* again, set height and width... */
      width: 50px;
    }
    #logo3 {
      background-image: url("logo3.gif");
      height: 50px;  /* again, set height and width... */
      width: 50px;
    }

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by creole
    SSI (Server-sude includes):
    <!--#virtual file="somefile.html" -->
    That'd be <!--#include virtual="" --> or <!--#include file="" -->


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •