attaterchal
New Member
Situation: I have a div which is 100% width of its parent. There is text in this div which needs to be centered/Also within that div I have another element which is supposed to have a percentage of the outer divs width, be it 0 to 100% (this area will have a background-color set). The code may look something like:\[code\]<div style="text-align:center; width:100%;">40% <div style="background-color: green; width:40%;"></div></div>\[/code\]So I would want the text '40%' to be centered and to the left of that 40% of the outer div will have the green background color.What am I doing wrong?Thanks.