我有此CSS代码,我需要对其进行调整,以使子级和父级下拉菜单彼此对齐。 (如下所示)
该代码适用于IE和Firefox,但不适用于Chrome。我需要修复代码以使其也可以在Chrome上运行。
这是我的CSS代码:
.ui-selectonemenu .ui-selectonemenu-label {
background: #c9e9e2 !important;
}
.ui-selectonemenu-panel .ui-selectonemenu-list {
background: #c9e9e2 !important;
box-sizing: initial !important;
padding-right: 80px !important;
text-align: left;
}
.ui-selectonemenu-item.ui-selectonemenu-list-item.ui-state-highlight {
background:#FFFFFF !important;
text-shadow: none;
color: #444444;
}
.selectOneMenu {
color: #444444;
font-size: 11px;
font-family: Verdana;
font-weight: 400;
height: 21px;
width: 158px !important;
}
最佳答案
我设法解决了这个问题。现在,我的代码可同时在Firefox和Google Chrome中使用。
我所做的是在.ui-selectonemenu-panel .ui-selectonemenu-list {
下添加了以下几行代码:
box-sizing: inherit;
display: inherit;
-webkit-column-width: 70px;
总的来说,这是我的代码:
.ui-selectonemenu-panel .ui-selectonemenu-list {
background: #c9e9e2 !important;
padding-right: 80px;
text-align: left;
box-sizing: inherit;
display: inherit;
-webkit-column-width: 70px;
}