-2

The background color black fills the padding area only As show below and I need it to cover the whole div area.

the black area is padding only!!

Html Code

Css Code

Shannon Duncan
  • 178
  • 1
  • 12

2 Answers2

1

Your issue is that when you float an element using css float:left or float:right, the parent container will lose it's natural height that is defined by its children.

You should read this post about floats and clears

Max Baldwin
  • 3,404
  • 3
  • 26
  • 40
1

Your problem is you floats here is my suggestion make it Flex:

.core {padding:50px;margin:0 auto;max-width:1000px; display: flex;}

https://jsfiddle.net/nwtttmqk/

You can also do inline....but flex is....more flexible (and modern)

Riskbreaker
  • 4,621
  • 1
  • 23
  • 31