Is there a way, when I have over lapping (touching) div's, to make the 1px border not become 2 pixels. And I know I could just put a border on 2 of the sides, but then the one edge of the div wouldn't have a border. By the way, I'm using jQuery Masonry.
You can’t make it less than a pixel. It doesn’t work like that. A pixel is the smallest physical beaming point on a display. You can try to use low colour contrast between the border colour and the background colour to make it feel thinner. So basically if you have a white background then use a light grey tone such as #ddd for the border.
The effect depends on the border-color value The border-style property can have from one to four values (for the top border, right border, bottom border, and the left border). A dotted border.
The border-width property specifies the width of the four borders. The width can be set as a specific size (in px, pt, cm, em, etc) or by using one of the three pre-defined values: thin, medium, or thick:
A pixel is the smallest physical beaming point on a display. You can try to use low colour contrast between the border colour and the background colour to make it feel thinner. So basically if you have a white background then use a light grey tone such as #ddd for the border. How do you make a CSS element not clickable?
yes the div on the right would look something like this
border: 1px solid #fff;
border-left: none;
the second border-left will override the left border that was just put on there
EDIT:
ok, since youre using jQuery masonary - do it like this
.container {
width:50px;
height:80px;
border:1px solid black;
margin-right: -1px;
margin-bottom: -1px;
}
the overlapping method I mentioned will work
Combining borders and margins (even with border-box) is tricky because your layout depends on the container width. It is better to add a child to the element positioned by Masonry and style that...
.container .post {
float: left;
width: 240px;
}
.container .text {
outline: 1px solid #999;
padding: 10px;
margin: 0 1px 1px 0;
}
outline
allows the border to appear "outside" the div which makes them easier to overlap
http://jsfiddle.net/4xmUY/
(if you happen to use this answer please accept Scott's answer as this should be a comment on his answer but the explanation doesn't fit there).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With