skip to Main Content

I have a div which has fixed width in px. but when I apply background color ( yellow ) on div its not covering whole div background. there still some 1px space is getting left blank.

enter image description here
enter image description here

any kind of suggestion appreciated.

i want the background-color to apply on whole div container.

2

Answers


  1. try to change the display of the outer contaier

    the problem is probably not from the div but from the container that the div is

    Login or Signup to reply.
  2. I dont know where is this "unchanged" 1px space is, top,bottom, left right.
    Usually to set background to div element this should work:

    div {
      background-color: yellow;
    }
    

    You can use HEX color code like: #ffff00

    If you have some 1px space left (at one of the sides), maybe you have a 1px border defined
    which has different color in div element or parent element:

    border-bottom: 1px solid red;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search