将单选按钮元素定位在背景图像上

编程入门 行业动态 更新时间:2024-10-24 18:27:06
本文介绍了将单选按钮元素定位在背景图像上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个backgorund图像,想放置一些单选按钮(单选按钮的圆圈将被隐藏,并且只会显示标签),正好靠近红色三角形(如此处). 我怎样才能做到这一点?请在这里查看我的代码

I have a backgorund image and want to position some radio buttons (the circle of the radio button will be hidden and only the label will appear) just close to the red triangles (as shown here) . How can I do this? Please see my code here

input[type="radio"] { display: none; } input[type="radio"]:checked + label { border: 2px solid red; }

<img src="i.stack.imgur/CUTm6.png" alt="Synoptic table" align="center"> <div class="buton"> <input type="radio" name="a" value="a" id="a" /> <label for="a">text radio 1</label> </div> <div class="buton"> <input type="radio" name="a" value="b" id="b" /> <label for="b">text radio 2</label> </div> <div class="buton"> <input type="radio" name="a" value="c" id="c" /> <label for="c">text radio 3</label> </div>

推荐答案

好,解决了这个问题. 我将位置作为包含单选按钮的div中的样式放置

Ok, managed to solve that. I put the position as a style in the div that includes the radio button

<div class="buton" style="position:absolute; left:400px; top:250px"> <input type="radio" name="a" value="b" id="b" /> <label for="b"> radio text 2 </label> </div>

更多推荐

将单选按钮元素定位在背景图像上

本文发布于:2023-10-08 02:54:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471301.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单选   按钮   图像   元素   背景

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!