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

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

WBOY
WBOYOriginal
2016-06-24 12:22:321751browse


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


Reply to discussion (solution)

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn