This is a migrated thread and some comments may be shown as answers.

[Solved] Using a sprite file to show icons in a item

1 Answer 78 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paulo de Tarso
Top achievements
Rank 1
Paulo de Tarso asked on 24 Aug 2011, 05:43 PM
how to use sprite file to show diferent icons in itens of a panel?

.HtmlAttributes(new { style = " background-image: url('../Common/Icons/IconsSprite.png') no-repeat top left; background-position: 0 -369px; width: 16px; height: 16px;" })

this code above don´t work...

Tks

Paulo de Tarso

1 Answer, 1 is accepted

Sort by
0
Paulo de Tarso
Top achievements
Rank 1
answered on 26 Aug 2011, 12:00 AM
The other code...

@(

           Html.Telerik().PanelBar()

            .Name("PBar")

            .HighlightPath(true)

            .HtmlAttributes(new { style = "width: 185px;  margin-bottom: 0px; position: relative;margin-left:auto; margin-right:auto;font-family: Arial , Sans-Serif;font-size: 12px;font-style: normal;" })

            .ClientEvents(events => events.OnSelect("onSelect"))

            .Items(item =>

                         {

 

                          item.Add()

                              .Text("Menu 1")

                              .HtmlAttributes(new { style = "font-family: Verdana, Tahoma, Arial,Helvetica Neue, Helvetica,                                

                                                   Sans-Serif; font-weight: bold;"

                                                  }

                                             )

                              .ImageHtmlAttributes(new { style = " background:url('Common/Icons/IconsSprite.png'  no-repeat                         

                                                         0 0 ); background-position: 0 -369px; width: 16px; height: 16px; " })

 

                         }

 )

 
but, don´t work...

tks

Tags
PanelBar
Asked by
Paulo de Tarso
Top achievements
Rank 1
Answers by
Paulo de Tarso
Top achievements
Rank 1
Share this question
or