Pixel gap in

I have four Divs placed using absolute positioning, each of which is the border of the rectangle that they form after grouping together to look if the Dom element on the page is selected (this mimics the behavior of the css border using the Div as overlays).

  • The left one has a border on the left set to “4px solid red” , a width of 0p x and a height equal to the height of the selected “Home” element .

  • The upper part has an upper border border equal to “4px solid red”, a height of 0px and a width equal to the width of the selected Dom element.

etc .. you can see where this is happening.

I know this is strange, but it is very useful, for example, aardvark .

So, here is what it looks like in FF, opera, safari and chrome:

alt text http://img243.imageshack.us/img243/429/captureyv.png

and this is how it looks in i.e. 8 :

alt text http://img190.imageshack.us/img190/7196/capture1dv.png

I immediately thought about the problem with the box, but does that not mean that it is already? and anyway, I used jquery to get the width and height, which should prevent this problem. I looked at the most famous, that is, errors , but I can not find a match.

What do you think?

ps: this is a bookmarklet, of course, I tried to change the doctype on the local file, and it worked, but in production I can’t.

ie dev, , :

alt text http://img21.imageshack.us/img21/3425/capture2uc.png

.

+3
5

"" "" BOTTOM IE8. , "0".

div.

<style type="text/css">
    #bottomBorder{
        /* Adding '!important' to each CSS rule 
           will make sure nothing else in your code is 'overwriting'
           that rule. (doesn't work for IE6)
        */
        line-height:0 !important; 
        font-size:0 !important;
        height:0 !important;
        border-bottom:solid 4px red;
        position:absolute;
    }
</style>

:

<style type="text/css">
    #bottomBorder{
        border-top:solid 4px red;
    }
</style>

, IE div 0px. divs .

+2

, DOCTYPE, IE .

+1

, - . - DIV? , .

div margin: 0; : ;

, , DIV , - DIV.

+1

, IE8 ? .

0

Ok, at the moment I have no solution, but I'm just showing the bottom top edge of the div, not its bottom edge, and at the moment it looks pretty good. If someone knows better, he still welcomes.

0
source

Source: https://habr.com/ru/post/1719542/


All Articles