SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot maileen's Avatar
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question when background-color addd margin :-(

    Hi,

    i'm facing a very interesting problem.
    i have div tag with the following setting:
    Code:
    #central_panel
    {
    	float : left;
    	display : inline;
    	/*position : relative;*/
    	margin : 0px 0px 0px 0px;
    	padding : 0px 0px 0px 0px;
    	width : 980px;
    	/*background-color : #ffffff;*/
    	/*height : 300px;*/
    }
    when i use such setting, my result is the following (and it is the problem):
    http://i220.photobucket.com/albums/d...olor-error.jpg

    when i uncomment the background-color line, i get the following result (and it is OK):
    http://i220.photobucket.com/albums/d...ndcolor-ok.jpg

    so how is it possible that a margin or padding about 30px is added just by commenting or uncommenting a background-color line ?

    when could be the problem ?

    thanks a lot,

    A

  2. #2
    SitePoint Zealot
    Join Date
    Feb 2008
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats a good question. Is there any content in there as the background-color will cover the whole of the content.

  3. #3
    SitePoint Zealot maileen's Avatar
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean exactly ?

    if in this div, there is other tag like div, or text... yes.

  4. #4
    SitePoint Zealot maileen's Avatar
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, i found where was the mistake.
    i had an image 3 px longer than the div where it was stored.

    so now everything is ok.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •