Home  >  Article  >  Web Front-end  >  CSS conflict issues

CSS conflict issues

PHP中文网
PHP中文网Original
2017-04-01 17:37:021247browse

defines a TD style of #mytable
such as:

td {   
     border-right: 1px solid #C1DAD7;   
     border-bottom: 1px solid #C1DAD7;   
     border-top:1px solid #C1DAD7;  
     border-left:1px solid #C1DAD7;  
     background: #fff;   
     font-size:12px;  
     color:Black;   
     padding: 6px 6px 6px 12px;   
 }


But one of my cells does not want this style.

Reply to the discussion (solution)

You can add a class to the td you specify, or you can set the attribute for the td you specify.

#mytable td:first-child{  
     /* 设置成初始状态 */   
     border-right:none!inportant;   
     background:none!inportant;  
     padding:none!inportant;  
 }


Or if you already have 2 tds, you can

#mytable td:last-child{  
     /* 第二个,也就是最后一个td添加你的css规则 */   
     border-right: 1px solid #C1DAD7;   
     border-bottom: 1px solid #C1DAD7;   
     border-top:1px solid #C1DAD7;  
     border-left:1px solid #C1DAD7;  
     background: #fff;   
     font-size:12px;  
     color:Black;   
     padding: 6px 6px 6px 12px;   
 }

add classes to other tds or add classes to this td

Just specify the class directly.

Only this cell is uncontrolled. . . Everything else must be controlled globally. . . Re-doing the CSS myself has no effect. I found that the main problem is this padding: 6px 6px 6px 12px;.

Stay tuned.

#mytable is the parent element. You can add a separate class to the child elements under the parent element, and then declare a separate style for this class

There is a JS in it CalendarControl. Pop up by clicking on the text box. Deformed.

Which td does not want which style, directly specify the inline style, or define a separate style to assign to the td

The above is the content of the CSS conflict problem, please pay attention to more related content PHP Chinese website (www.php.cn)!

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