If you have used Google Reader. There is a toggle icon you can click and expand all items view size. This toggle icon is a small blue arrow. Is it a image? No. It's just a CSS tips and tricks. How does CSS do it?
Toggle icon DOM element
... <td id="chrome-lhn-toggle"> <div id="chrome-lhn-toggle-icon"></div> </td> ...
Toggle icon CSS
{ width: 0; height: 0; border-color: #ebeff9 #68e #ebeff9 #ebeff9; border-style: solid; border-width: 5px 5px 5px 0; }
You just need to assign the "border" CSS to toggle icon DOM element like ahove.
You may have to assign others CSS if you want this toggle icon in that correct position you want.
border Css order style
#right{ border-style:solid; border-color: red green blue yellow; border-style: solid; border-width: 50px 50px 50px 50px; width:0; height:0; display:inline-block; } #left{ border-style:solid; border-color: #ebeff9 #68e #ebeff9 #ebeff9; border-style: solid; border-width: 50px 50px 50px 50px; width:0; height:0; display:inline-block; }
Whole DOM and CSS code
//DOM ... <td id="chrome-lhn-toggle"> <div id="chrome-lhn-toggle-icon"></div> </td> ... //CSS #chrome-lhn-toggle:hover { background: #C2CFF1; } #chrome-lhn-toggle, #chrome-viewer { padding: 0px; vertical-align: top; } #chrome-lhn-toggle { background: #EBEFF9; cursor: pointer; width: 8px; } #chrome-lhn-toggle:hover #chrome-lhn-toggle-icon { border-color: #C2CFF1 white #C2CFF1 #C2CFF1; } #chrome-lhn-toggle-icon { border-color: #EBEFF9 #68E #EBEFF9 #EBEFF9; border-style: solid; border-width: 5px 5px 5px 0px; height: 0px; margin-left: 1px; margin-top: -5px; position: absolute; top: 50%; width: 0px; } #chrome-lhn-toggle-icon { font-size: 1px; line-height: 1px; }
Conclusion
This is a simple way to make a arrow icon by pure CSS instead of assigning image.
a really good post man thanks for sharing
ReplyDeletehotmail sign up
Thanks for provide great informatic and looking beautiful blog
ReplyDeletepython training in bangalore | python online training
aws online training in bangalore | aws online training
artificial intelligence training in bangalore | artificial intelligence online training
machine learning training in bangalore | machine learning online training
data science training in bangalore | data science online training