need help with showing css bars

Discussion in 'CSS' started by aka.snowball, Jun 7, 2010.

  1. #1
    If I would like to have the bar to have diffrent colors, how can this be done?

    I have tried the following

    css file

    .graph { 
            position: relative;
            width: 200px; 
            border: 1px solid #B1D632; 
            padding: 2px; 
        }
    	.bar_low{
    	background: ##ff0000;
    	}
    	.bar_lowMid{
    	background: ##ffb700; 
    	}
    	.bar_mid{
    	background: ##fff700;
    	}
    	.bar_midHigh{
    	background: ##aeff00;
    	}
    	.bar_high{
    	background: ##0eff00; 
    	}
        .graph .bar_low .bar_lowMid .bar_mid .bar_midHigh .bar_high { 
            display: block;
            position: relative;
            text-align: center; 
            color: #333; 
            height: 2em; 
            line-height: 2em;            
        }
        .graph .bar_low .bar_lowMid .bar_mid .bar_midHigh .bar_high span { position: absolute; left: 1em; }
    Code (markup):
    and in html

    <div class="graph">
    <strong class="bar_mid" style="width: 75%;">50/100</strong></div>
    Code (markup):
    Why don't the bar show for example bar_mid, only the graph shows?

    Thanks :)
     
    aka.snowball, Jun 7, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Remove the second hash from the colors.
     
    Cash Nebula, Jun 9, 2010 IP
  3. johagulo

    johagulo Peon

    Messages:
    879
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Always mention float, height and width, then try it with background-color
     
    johagulo, Jun 12, 2010 IP