Home > Article > Web Front-end > Programmers who haven't slept at two o'clock, similar to this grid display, how to merge the middle borders of css_html/css_WEB-ITnose
div.content
{
float:left;
border:1px solid #FFFFFF;
width:100px;
line-height:75px;
}
The grids formed by floating like this are arranged one by one, but the middle border becomes 2px. Is there any way to do it?
Writing the program is so hard, it lasts until after 2 o'clock at night
The outermost div padding1px
Set only two sides
border-left:1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
Set only two sides
border-left:1px solid #FFFFFF;
border-top:1px solid #FFFFFF;
Moderator’s correct answer
border:1px solid #FFFFFF; This is a border of 1px, so your middle box becomes 2Px
Don’t use a border and use padding/margin instead
Because you have a white border and a white background. , the effect of setting the margin is the same, and it is easier to control
Instead of using a border, use padding/margin
Because if you have a white border and a white background, the effect of setting the margin is the same, and it is also Easier to control
Support this
The correct answer on the 2nd floor is to only set the left and top borders