html - 检查 div 影响它之前写的其他 div

标签 html css

我有一个问题,实际上对我来说很难定义,很抱歉主题名称。谈到这个问题......我几乎没有彼此相邻的输入。喜欢:

<input type="radio" name="radio-set" id="st-control-2"/>
            <a href="#"></a>
            <input type="radio" name="radio-set" id="st-control-3"/>
            <a href="#"></a>
            <input type="radio" name="radio-set" id="st-control-4"/>
            <a href="#"></a>
            <input type="radio" name="radio-set" id="st-control-5"/>
            <a href="#"></a>

在CSS中

input#st-control-3:checked ~  input {
    left:-200%; }

    input#st-control-3:checked ~  a {
    left:-200%; }

我想通过点击例如 #st-control-3 来移动其他输入。它有效,但仅适用于#st-control-3 之后编写的元素(在我的例子中是输入),因此在我的示例中,效果不会出现在#st-control-2 上。

所以问题是如何影响非parent或child并且写在active元素之前的元素。

我希望我写的很清楚。

最佳答案

关于html - 检查 div 影响它之前写的其他 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30108158/

相关文章:

html - 使用 Css calc() 对齐伪元素以在所有屏幕上工作

html - 如何在 Firefox 中将 FILTER/MASK 应用于图像

Java HTML 解析(链接)

CSS3 背景雕刻或半径问题

jquery - 如何让div无法悬停?

html - Bootstrap 表格垂直滚动

java 小程序无法在 html 中运行

html - CSS/HTML : Separate background from divs

javascript - float 图调整大小错误,高度无效

反向缩进的 CSS?