久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

多個元素的 CSS 選擇器

CSS-Selector for multiple elements(多個元素的 CSS 選擇器)
本文介紹了多個元素的 CSS 選擇器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我完全不知道如何使用更高級的 css 選擇器,例如 + 或 >但是由于我現在需要它來防止過多的 JS,也許有人可以幫助我解決這個塊的這種特殊情況:

I am not at all getting how to use more advanced css-selectors like + or > But as I am now needing it to prevent too much JS, maybe someone can help me out with this particular situation of this block:

<section class="rf_re1-suche_container">
    <input type="search" placeholder="Your search">
    <button>Send</button>
</section>

我想這樣做:

.rf_re1-suche_container input:focus{
    background:orange;
}

但也適用于按鈕.所以:如果輸入有焦點,我希望輸入和按鈕具有相同的背景.我該怎么做?謝謝!

but also for the button. So: If the input has a focus I want the input AND the button to have the same background. How would I do that? Thanks!

推薦答案

您需要分別定位輸入和按鈕.因為您希望這僅在輸入具有焦點時應用,所以您需要重復整個選擇器,包括 input:focus 部分,然后使用 + 組合器鏈接焦點輸入的按鈕:

You will need to target the input and the button separately. Because you want this to apply only when the input has focus, you will need to repeat the entire selector including the input:focus portion, then use a + combinator to link the button to the focused input:

.rf_re1-suche_container input:focus,
.rf_re1-suche_container input:focus + button {
    background: orange;
}

<section class="rf_re1-suche_container">
    <input type="search" placeholder="Your search">
    <button>Send</button>
</section>

這篇關于多個元素的 CSS 選擇器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Secure random numbers in javascript?(在javascript中保護隨機數?)
Authorization header in img src link(img src 鏈接中的授權標頭)
Sending Authorization Token Bearer through Javascript(通過 Javascript 發送 Authorization Token Bearer)
Do I have to store tokens in cookies or localstorage or session?(我必須將令牌存儲在 cookie 或本地存儲或會話中嗎?)
How to decode jwt token in javascript without using a library?(如何在不使用庫的情況下在 javascript 中解碼 jwt 令牌?)
:hover:before text-decoration none has no effects?(:hover:before text-decoration none 沒有效果?)
主站蜘蛛池模板: 国产精品a级 | 午夜国产一级 | 波多野结衣一区二区三区在线观看 | 久久久精品久久 | 久久国产视频一区 | 久久精品综合 | 黄色网址大全在线观看 | 久久久久九九九九 | 亚洲一区久久 | 久久精品中文 | 综合久 | 天天爽综合网 | 日韩视频国产 | 国产美女精品视频 | 国产一区二区在线免费观看 | 精品视频免费 | 激情五月婷婷综合 | 国产成人精品免费视频大全最热 | 欧美成人一区二免费视频软件 | 成年人网站国产 | 四虎影院免费在线播放 | 在线看片福利 | 黄色一级大片视频 | 国产成人网| 国产一级在线观看 | 在线一区二区三区 | 国产精品毛片一区二区在线看 | 免费中文字幕 | 欧美激情 一区 | 91精品国产91久久久久久不卞 | www.一区二区三区.com | 国产精品观看 | 欧美日韩一二三区 | 欧美专区在线 | 亚洲一区中文字幕在线观看 | 欧美精品tv | 91啪亚洲精品| 欧美在线免费 | 日韩在线小视频 | 国产精品视频在线播放 | www久久久|