April 28, 2011

Background not visible due to positioning

Question by dragonfly

The background color of <ol> list is not displayed properly. This problem started after I floated label left and input right. How to fix this. The expected result is:

enter image description here

Here is my result: http://fiddle.jshell.net/WZ3nM/1/

Similarly I’ve problem with the div .wrapper. The shadow should be way below the content and there should be a white color background beneath <div class=.col-2>.

Answer by Elliott

I modified your code and added a third <li> with the following style:

clear:both;

Your float was taking elements out of the document flow and this the background color didn’t know where to end.

Hope that helps.

Answer by Starx

You need to clear the float, before you close your <ol>

Check it out here.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!