Apply mouse hover on gridview in MVC using custom css

Total Post:3

Points:21
C#
 346  View(s)
Ratings:
Rate this:

Hi,

I want to apply mouse hover on my gridview using custom css. 

Below is my code.

 <div class="qa-part-nav-list">

        <ul class="qa-browse-cat-list">
            @foreach (var item in Model)
            {
                <li class="qa-browse-cat-item qa-browse-cat-arts-and-humanities">
                    <a href="@Url.Action("QuestionByCategory", "home", new { @category = item.UrlSlug })">
                        <span style="font-size: medium">
                            @if (item.Name.Length > 14)
                            {
                                @item.Name.Substring(0, 14).ToString();
                            }
                            else
                            {
                                @item.Name.ToString();
                            }
                        </span>
                        <span class="badge badge-info pull-right">@item.TotalPost questions</span>
                    </a>
                </li>
            }
        </ul>
    </div>

Please give me some solution to accomplish this task....

  1. Post:44

    Points:310
    Re: Apply mouse hover on gridview in MVC using custom css

    Hi Satish,

    Please follow below line of code to achieve your task.

    <style>
    
        .badge-info {
            background-color: #061660; // You can change color as your requirement
        }

            .badge-info:hover {
                background-color: #0623aa; // You can change color as your requirement
            }
    </style>

    Hope its informative .....!!

Answer