-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi
I am creating hyperlink using toolbarbutton. I have defined set of custom style to one of the toolbarbutton on the page. (page may contain more than one toolbarbutton, but styles should be applied to specific button)
The issue is only the first style is gets applied.
How to group the style in one name and apply to particular button?
Here is the code
<?page id="login" ?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<style dynamic="true">
.hyperlink .z-toolbarbutton-cnt{
padding:2px 2px;
position:relative;
zoom:1;
font-family:${fontFamilyT};
font-size:${fontSizeS};
font-weight:bold;
color:blue;
}
.hyperlink1 .z-toolbarbutton-over{
border-top:1px solid white;
border-bottom:1px solid white;
border-left:1px solid white;
border-right:1px solid white;
padding:0;
}
.hyperlink2 .z-toolbarbutton-over .z-toolbarbutton-cnt{
background-image:none;
text-decoration:underline;
color:#54630e;
}
</style>
<window style="padding-top:15px">
<toolbarbutton sclass="hyperlink hyperlink1 hyperlink2" label="Logout" />
<toolbarbutton label="Help" />
</window>
</zk>
Any help on this?
Thanks
Abhi
the css class 'z-toolbarbutton-over' of toolbarbutton is on the same dom,
so you should write the selector together .
.hyperlink1 .z-toolbarbutton-over -> .hyperlink1.z-toolbarbutton-over (no space, they are in same dom css class)
Hi dennis,
Thanks a lot for the suggestion.
I have modified my code as per your guideline. I got my expected result in google chrome browser and Firefox.
However,
1. In IE 7,hyperlink class gets applied to Logout button, which is correct. But hyperlink1, hyperlink2,hyperlink3 class gets applied to both Logout and Help button, which is wrong. My expected result is it must be applied to only Logout button.
Here is my modified code:
<?page id="login" ?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<style dynamic="true">
.hyperlink .z-toolbarbutton-cnt{
padding:2px 2px;
position:relative;
zoom:1;
font-family:${fontFamilyT};
font-size:${fontSizeS};
font-weight:bold;
color:blue;
}
.hyperlink1.z-toolbarbutton-over{
border-top:1px solid white;
border-bottom:1px solid white;
padding:0;
color:blue;
}
.hyperlink2.z-toolbarbutton-over .z-toolbarbutton-body{
border-left:1px solid white;
border-right:1px solid white;
padding:0;
}
.hyperlink3.z-toolbarbutton-over .z-toolbarbutton-cnt{
background-image:none;
text-decoration:underline;
}
</style>
<window style="padding-top:15px">
<toolbarbutton sclass="hyperlink hyperlink1,hyperlink2 hyperlink3" label="Logout" />
<toolbarbutton label="Help" />
</window>
</zk>
Note: I am novice to ZK
Could you guide me further to achive my expected result?
Thanks
Abhi
Asked: 2011-10-13 04:45:23 +0800
Seen: 415 times
Last updated: Oct 13 '11