How to make a DIv with a Rails Link clickable?

后端 未结 3 880
南旧
南旧 2020-12-30 00:18

I have a large div:

.limeskin:hover {
  background: #eee;
  cursor: pointer;
  display: block;
}

that I want to be clickable. Because I\'m

3条回答
  •  我在风中等你
    2020-12-30 00:47

    Using Link_to as below would be sufficient even when you have a big block including multiple tags:

    <%= link_to desired_path do %>
        
    ... some other tags
    <% end %>

    and I recommend you to use a different background color for mouse over events because it shows the viewer that it's a link!

    In you .css file:

    .linkable:hover{
        background-color: red;
    
    }
    

提交回复
热议问题