Previously, I summarized how to use CSS to achieve the border + bordercolordark + bordercolorlight effects of a table. Then a netizen asked me why he wrote a similar CSS style, but the table border effect can only be seen normally under Opera, but nothing under IE. I downloaded Opera 9 and saw that it was indeed the case. The reason is not complicated: because in IE (Firefox seems to be the same as IE), if the content of a td is empty, even if you set the height and width, the border style of the cell will not be displayed; Opera applies the style to render regardless of whether there is content or not. I encountered this problem right after I graduated. The section chief of the department came to ask me, and I told him: Just add it to each empty td. Whenever I encounter this problem in the future, I will use this simple, rough and effective method to solve it. But today I made great efforts to study it a bit, and learned from Jiarry that the original CSS syntax allows us to change these default behaviors: using border-collapse:collapse; and empty-cells:show; can make the disappeared border appear. class="test1": add border-collapse:collapse; .test1{ border:1px solid #999999; border-collapse:collapse; width:60% } .test1 td{ border-bottom:1px solid #999999; height:28px; padding-left:6px; } class1 Here is the content Here is the content class="test2": add border-collapse:collapse; and empty-cells:show; .test2{ border:1px solid black; border-collapse:collapse; width:60% } .test2 td{ border-bottom:1px solid black; height:28px; padding-left:6px; empty-cells:show; } class2 Here is the content Here is the content class="test3": Without border-collapse:collapse; and empty-cells:show; .test3{ border:1px solid #999999; width:60% } .test3 td{ border-bottom:1px solid #999999; height:28px; padding-left:6px; } class3 Here is the content Here is the content |
<<: Examples of using MySQL covering indexes
>>: Analysis and solution of the reason why overflow-y: visible; does not work in CSS
1. Unzip the zip package to the installation dire...
Table of contents Brief summary At noon today, th...
background When performing a SQL query, I tried t...
Table of contents Prototype chain We can implemen...
In our daily work, we often come into contact wit...
Demand scenario: The boss asked me to use the cra...
Preface Today, after synchronizing the order data...
The span tag is often used when making HTML web pa...
Drop-shadow and box-shadow are both CSS propertie...
Preface Recently, many new colleagues have asked ...
Table of contents Preface Basic Concepts of Argum...
Copy code The code is as follows: <select> ...
Many people may ask, does the text on the website...
<br />Original source: http://www.a-xuan.cn/...
Table of contents 1. Constructors and prototypes ...