Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:43:32+00:00 2026-05-29T10:43:32+00:00

i have a gamimng section on my site that allow the user to display

  • 0

i have a gamimng section on my site that allow the user to display a quick status of their stats using colors (blue, red, and green).

i want to generate something like this based per user. i have this so far:

<style>
.box2 {
    height: 20px;
    background: blue;
    float:left;
    width:120px;
}
.box3 {
    height: 20px;
    background: green;
    float:left;
    width:30px;
}
.box1 {
    height: 20px;
    background: red;
    float:left;
    width:140px;
}
</style>

<div>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</div>

should i put the css directly in the page? what will be the best way to implement this using php?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:43:32+00:00Added an answer on May 29, 2026 at 10:43 am

    You can always use a generated file using PHP and include it as your CSS file like:

    <link rel="stylesheet" type="text/css" href="/css/userstats.php" />
    

    Then in this file you can use the current session to find out the user stats then generate using PHP. Don’t forget the put the header:

    header("Content-type: text/css");
    

    Example php:

    background: #<?php echo $colorX; ?>; // assuming the $colorX is HEX
    

    You can also if you prefer use .htaccess to rewrite the file so it looks less obvious like:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^css/userstats.css$ /path/to/generatedfile.php [L,NC]
    

    So you can use:

    <link rel="stylesheet" type="text/css" href="css/userstats.css" />
    

    example code:

    <style>
    div.bar {
        height: 25px;
    }
    div.bar div {
        display: block;
        float:left;
        height: 25px;
        margin: 0;
        padding: 0;
        position: relative;
    }
    div.bar div.red {
        background: #DD3030;
        -webkit-box-shadow: -5px 0px 8px 2px #DD3030;
        -moz-box-shadow: -5px 0px 8px 2px #DD3030;
        box-shadow: -5px 0px 8px 2px #DD3030;
        width:140px;
        -moz-border-radius-topleft: 8px;
        -moz-border-radius-topright: 0px;
        -moz-border-radius-bottomright: 0px;
        -moz-border-radius-bottomleft: 8px;
        -webkit-border-radius: 8px 0px 0px 8px;
        border-radius: 8px 0px 0px 8px;
        z-index:10;
    }
    div.bar div.blue {
        background: #3388DD;
        -webkit-box-shadow: 0px 0px 8px 2px #3388DD;
        -moz-box-shadow: 0px 0px 8px 2px #3388DD;
        box-shadow: 0px 0px 8px 2px #3388DD;
        width:120px;
        z-index:5;
    }
    div.bar div.green {
        background: #1CAD32;
        -webkit-box-shadow: 5px 0px 8px 2px #1CAD32;
        -moz-box-shadow: 5px 0px 8px 2px #1CAD32;
        box-shadow: 5px 0px 8px 2px #1CAD32;
        width:30px;
        -moz-border-radius-topleft: 0px;
        -moz-border-radius-topright: 8px;
        -moz-border-radius-bottomright: 8px;
        -moz-border-radius-bottomleft: 0px;
        -webkit-border-radius: 0px 8px 8px 0px;
        border-radius: 0px 8px 8px 0px;
        z-index:10;
    }
    </style>
    
    <div class="bar">
        <div class="red"></div>
        <div class="blue"></div>
        <div class="green"></div>
    </div>
    

    jsfiddle: http://jsfiddle.net/g9Vrx/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web project using jsf2 implementing a gaming web site on tomcat7.
I have a stored procedure that runs to update gaming points for user balances.
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
I have created a gaming application that has only one window. Application is created
I have many SWF file those I have included in my web page using
I have read about using CompositionTarget.Rendering Timer for the primary gaming loop in silverlight.
I have a JPanel that I have created a MouseListener for and I am
Summary I have been looking at historical Australian Rules outcomes using excel with an
I have an air application that I'd like to turn into a multi-player game.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.