[英]height: 0; overflow: hidden; not working with padding
我有這段代碼,我的目標是使自定義 select 平滑 animation。我選擇讓我的高度默認為 0 溢出:隱藏,並將高度設置為自動 when.active 添加。 但是遇到了仍然顯示身體的問題。 問題似乎與填充有關 .select-header { display: flex; justify-c ...
[英]height: 0; overflow: hidden; not working with padding
我有這段代碼,我的目標是使自定義 select 平滑 animation。我選擇讓我的高度默認為 0 溢出:隱藏,並將高度設置為自動 when.active 添加。 但是遇到了仍然顯示身體的問題。 問題似乎與填充有關 .select-header { display: flex; justify-c ...
[英]How to make image transition smoothly with toggle button
我使用 transition 來使更改變得平滑並且它正在工作,但是對於圖像我無法設置好。 我怎樣才能解決這個問題? 我試過這個:var lightsOff = document.querySelector("#lights-off"); var lightsOn = document.querySe ...
[英]Fill element with slanted background on hover left to right, left to right
有沒有什么辦法可以讓這個 animation 也有傾斜的背景? 使用純 css 還是反應 spring? Hover animation 我已經嘗試了兩種解決方案,但不是 em go 我誹謗背景 + 從左到右,從左到右 animation。 HTML: 我多么希望 slider 看起來像誹謗。 ...
[英]Transition effect on before element
我正在嘗試讓“預約”按鈕在這個網站https://templates.hibootstrap.com/arrola/default/index-2.html上工作。 我有以下 css 和 html 元素: <a className={styles.appointmentButton} href ...
[英]Why do equal duration transitions take different amounts of time?
我有兩個嵌套元素: A和B 。 外部元素A與內部元素B的大小相同。 元素B包含一些文本。 兩個元素都有一個持續時間為一秒的 CSS 過渡。 在 hover 上, A更改了文本顏色,而B更改了背景顏色。 #A { color: red; transition: all 1s; } #B { fon ...
[英]Vue 2 <transition mode=out-in> not transitioning the first element
使用 Vue 2.6.14,我使用 v-if 和 v-else 在兩個按鈕之間切換。 我將所有內容都包裝在一個過渡中,但第一個元素從不過渡,既不進也不出。<transition name="fade" mode="out-in"> <TappaPaginazione v-if= ...
[英]How to add slide-down and slide-up animations to dropdown menu
我的網站上有一個國際國家代碼選擇選項,為此我想實現平滑的向下滑動和向上滑動 animation 切換 function 到我的網站。 在我的例子中,上下兩邊都不起作用。 如果向下滑動比向上滑動不工作,如果向上滑動比向下滑動不工作。 這就是為什么我需要專家幫助來實現這個 animation 效果。 我 ...
[英]Problem with background-image hover effect - zoom out doesn't work for the right edge
你能不能看看這個? 我有這段代碼: HTML: CSS: 代碼筆:代碼筆鏈接我希望這張圖片在 hover 上變小。它正在工作,但僅適用於頂部、底部和左側,但右側保持不變(我的意思是它不會在右側邊緣的 hover 上更改其 position)。 您是否知道如何解決這個問題以及我做錯了什么? 先感謝 ...
[英]Reversing CSS transition after unhover
我做了這個簡單的 animation。但是當我“取消懸停”時,轉換后的跨度就會“消失”。 有什么簡單的方法可以將跨度向后滑動,又名。 取消懸停后反轉過渡。 或者如果需要任何復雜的方式? 如果可能的話,如果解決方案只有 CSS 就好了。 提前致謝! #container { display: fle ...
[英]React CSSTransition creates new page twice and runs the transtion on these two identical pages
我使用react-router和useNavigate在頁面之間切換。 通過CSSTransition ,我想在頁面之間進行平滑過渡。 不幸的是,它沒有按預期工作,路由器立即刪除當前頁面並創建新頁面兩次,然后在這兩個相同的頁面上執行轉換。 應用程序.jsimport "./styles.css"; ...
[英]How can I make a transition from left to right?
我希望我的按鈕通過從左到右的過渡來更改 hover 上的背景顏色。 這是我試過的: ...
[英]On image click hide the image and display a div with transition
我正在研究一個搜索欄。 首先,用戶將只能看到搜索圖標。 當用戶單擊搜索圖標時,該搜索圖標將被替換為包含新搜索欄的 div。 我希望當用戶點擊搜索圖標時,新的 div 會以 1 秒的過渡時間出現,新的 div 看起來像是搜索圖標的擴展版本。 ...
[英]Underline transitions on hover give thick border
我正在嘗試為我的菜單項創建下划線過渡。 我遵循了這篇文章的答案,但差別很小:在它用於設置邊框的答案 css 上: a { text-decoration: none; display: inline-block; } a:after { content: ''; display: block; b ...
[英]CSS or JavaScript for animation
我想更改我的代碼,以便在我的布局更改時出現滑動 animation。 這是一個 3 列布局,我希望最左邊的列縮小,但是當用戶關注屏幕的右側 2/3 時。 我寫了一個簡單的代碼筆來演示我的代碼。 我正在使用 JS 在兩個 CSS 類之間進行轉換,但我想為其添加一個滑動轉換。 我不確定這是否應該是 1 ...
[英]CSS transition from right to left
我想將 CSS 應用於我的項目,並在以下鏈接中使用 animation 的轉換。 在此示例中,過渡從左到右移動,但我想要從右到左的過渡。 任何解決方案都會有所幫助提前致謝。 ...
[英]CSS transition wont working properly when appending dynamically class
我為自己的主 div 寫了一個 CSS: 當我自己的程序中的某些狀態發生變化時,我會觸發.visible CSS 類。 但它不起作用。 檢查我的 React 部分: 除 CSS (.visible) 類外,所有東西都正常工作! 為什么以及如何安裝它? 編輯 我將片段分成一些部分,但過渡仍然不起作用。 ...
[英]How to create a square box in which the border of the box will be filled by color depending on the value given on the box?
就像上面的圖片或實現此設計的想法或參考,我感謝社區提供的幫助或建議謝謝我得到了進度條的參考,它是圓形的但找不到解決它的方法。 ...
[英]How to use 'CSSTransition' in react-router that has 'Link' in each component?
我有一個包含“路由”的“CSSTransition”組件,但我不能在“鏈接”組件中放置一個更改“狀態”的函數,因為每個組件都在不同的文件中在 routes.js 中 在每個組件中 StartPage.js 中未定義更改“CSStransition”狀態的函數“setIsEnter()” ...
[英]How does one make a transition for removing a div completely, not just visibility?
我如何做到這一點,以便當您將鼠標懸停時,原始 div 完全消失,而不僅僅是可見性,並且這樣做有一個過渡,並且新的 div 在過渡完成之前不會出現? 使用 javascript 很好。 我知道使用 display 不允許轉換,但這是我唯一能想到的並且很好地了解了我要完成的事情。 這是 HTML: 這 ...
[英]How to trigger CSS animation once user change the slide?
我正在為我的幻燈片內容使用Animate 。 我想在用戶每次來回走動時應用 css 轉換。 然而我的第一張幻燈片有我想要的轉換,但問題是它們同時加載。 我需要某種 js 函數來在幻燈片切換之前調用轉換。 ...