Posts

Showing posts from August, 2018

Why position relative leaves empty space below the div?

When we want to move the div, we give position:relative to the div and moved div to top-bottom, left-right directions like- div{        position: relative;        top: -127px;        right: 50px;   }         But, usually when we give position:relative to the div, the position:relative leaves empty space below the div. So, In this case, we can use a nagative margin-bottom in the relative element that you have moved   like- div{         position: relative;         top: -127px;         right: 50px;        margin-bottom: -127px;   }       

Why background image not displaying? Here are some basic errors.

Sometimes, the background image not displaying in our browser because we forget to write folder name, to give height, etc. There are several basic errors. Some basic errors are as following- 1.We forget to write the folder name with image name like-     body{           background: url(imagename) no-repeat center;     } So, first of all check the folder name. 2. Sometimes, the height is not give to the div or the height is auto.So, in this case, check the height property and give height to the div. 3.The folder name and image name is not correct.    like- Our folder name is images and we write folder name is image. The image format is JPG and we write image format PNG. So, check the folder name and image format. 4.When we write the correct code and even then our background image not displaying in the browser. Correct code:-      body{          background: ur...