I think this question is only related with css... but I will give you some context:
I am working with the zk framework and I have some comboboxes in my zul page... ZK render its components and turn them into html components with some predefined styles (css classes)... I can override those styles... but I want to override a whole css class with another so I can put my css class only in the components I want to change its style.
This is how a combobox is created:
As you can see, it is turn into an input
with a css class called z-combobox-input
If I overwrite that class directly, like this:
.z-combobox-input{
border:1px solid #000;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;-o-border-radius:3px 0 0 3px;-ms-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;margin:0;padding:4px 5px;line-height:14px;background:#fff
}
It will afect every combobox in the page, as a result I get:
So I want to know if exist a way to do something like this:
.class-original{
//some styles in here
}
.class-overriding{
.class-original{
//new styles in here
}
}
So I can put my .class-overriding only in the components I need to change and not in every component of the same type.
<combobox id="newCombo" sclass="class-overriding" />
I made this fiddle if you want to try a solution.
I was seeing this question and apparently it is not possible... So: is there another way to achieve that?
Thank you.
UPDATE
I cannot use the id that is generated dinamically (in this case "vXgV3-real").
I can modify some properties from the combobox either by putting a css class or by using the tag style
:
<combobox id="combo1" style="background: red" />
But I cannot change that border in particular, like this:
<combobox id="combo2" style="border:1px solid #000;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;-o-border-radius:3px 0 0 3px;-ms-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;margin:0;padding:4px 5px;line-height:14px;background:#fff"/>
Because when it is render (when zk change its component to html components) it turns in this:
So, when zk change the combobox
component to:
<span id="nZEQo" style="width:80%;" class="myCombo z-combobox">
<input id="nZEQo-real" class="z-combobox-input" autocomplete="off" value="" type="text" style="width: 269px;">
<a id="nZEQo-btn" class="z-combobox-button">
<i class="z-combobox-icon z-icon-caret-down"></i>
</a>
<div id="nZEQo-pp" class="z-combobox-popup myCombo" style="display:none">
<ul id="nZEQo-cave" class="z-combobox-content"></ul>
</div>
</span>
It put random id's to the html components.
Fiddle with this particular part
Some documentation:
Customize Look and Feel of ZK Components Using CSS3 - Part 2