CSS conflict issues

PHP中文网
Release: 2017-04-01 17:37:02
Original
1243 people have browsed it

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;   
 }
Copy after login


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;  
 }
Copy after login


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;   
 }
Copy after login

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 (m.sbmmt.com)!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template