- This topic is empty.
-
AuthorPosts
-
September 7, 2016 at 5:58 pm #245308
Historical Forums User
ParticipantSo I want to have different :hover cursor in an element, lets say pointer on the element, n-resize for the margin-top, and s-rezie for the margin bottom. I know I can make a different div before and after the span element to have the selector that. The problem is, the tree HTML is auto-generated from a JS library (fancytree, a tree library), I’m afraid if I manually insert another element before and after the span, the functionality will breaks. Any help is appreciated, thanks!
Here is the following image explaining the situation.
http://imgur.com/a/R18Z7Here is the LESS code, the before and after doesn’t work (I know this is not the solution, I just provides what I tried)
span.fancytree-node { /* See #117 */ display: inherit; // #117, resolves to 'display: list-item;' for standard trees width: 100%; margin-top: @fancy-node-v-spacing; margin-bottom: @fancy-node-v-bottom-spacing; min-height: @fancy-line-height; cursor: pointer; :before { cursor: n-resize; } :after { cursor: s-resize; } }
EDIT:
To make it more clear, I need the margin, I can’t add another element above and below the element, because that margin is used by my JS library to detect drag n drop placement.September 7, 2016 at 6:20 pm #245310JamiePatt
ParticipantWhy not just something like:
.element:before, .element:after{ content: ' '; height: 10px; } .element:before {cursor:n-resize;} .element:after {cursor:s-resize;} .element {cursor:pointer;}
September 7, 2016 at 6:37 pm #245313Historical Forums User
ParticipantAh sorry, to make it more clear, I need the margin, I can’t add another element above and below the element, because that margin is used by my JS library to detect drag n drop placement.
September 7, 2016 at 8:47 pm #245315Historical Forums User
ParticipantSorry @JamiePatt,
You are right, I need to use :before :after,
but your code is incomplete,
because my CSS skill is SUCKS so I can’t adopt it to my usage.Someone over at Stackoverflow solved this problem in case anyone have the same problem http://stackoverflow.com/a/39381696/3390639
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.