W
W
weranda2018-03-14 11:13:02
css
weranda, 2018-03-14 11:13:02

How to place blocks of text above or on input?

Greetings
Is it possible to do something with this HTML code using styles:

<form>
    <div>Нравится</div>
    <div>+15</div>
    <input type="submit">
</form>

So that the final look would be like this:
5aa8d8bb55160872740543.pngAnd did it work?
I mean overlaying two divs on top of the input in such a way that when they/button are clicked, an action occurs. Right now the divs overlap the button and it can't be clicked. Of course, you can use JS, but is there a way to design this whole thing without it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Talalaev, 2018-03-14
@neuotq

Once you have everything set up, it is most reasonable to set the divs that overlap the button with the pointer-events property set to none. This way the browser will ignore mouse events for these elements.

A
Alexander Alekseev, 2018-03-14
@shure348

<form>
    <label>
        <div>Нравится</div>
        <div>+15</div>
        <input type="submit">
    </label>
</form>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question