Hongmu Notes
Home Language Notes css siblings fade
Language Notes CSS

css siblings fade

css siblings fade

Fade out the hovered item's sibling.

Use a to animate the changes to . transitionopacity
Use the and pseudo-class selectors to change all elements except the element the mouse is over. :hover:notopacity0.5


<div class="sibling-fade">
  <span>Item 1</span> <span>Item 2</span> <span>Item 3</span>
  <span>Item 4</span> <span>Item 5</span> <span>Item 6</span>
</div>

span {
  padding: 0 16px;
  transition: opacity 0.3s;
}

.sibling-fade:hover span:not(:hover) {
  opacity: 0.5;
}

 

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

css positioning

css positioning Language Notes CSS

Syntax: position: static | relative | absolute | fixed | center | page | sticky Default value: static Applies to: All elements except the display attribute defined as table-column-group | table-column Inheritance: No Animation: No...
👁 119
css vh and vw adaptive

css vh and vw adaptive Language Notes CSS

In the mobile terminal, REM is used to change the root HTML, and the mobile terminal adaptation is realized through a piece of JS. This article uses pure CSS viewport units to self-adapt. Although the current compatibility is not fully acceptable, it does not prevent you from recognizing the power of vw and vh. The implementation of responsive layout relies on media queries (Media Queries). Select the width size of mainstream devices as breakpoints to target...
👁 356

Recommended reading

Responsive Electronic Products Foreign Trade Enterprise Website Template 1090

Responsive Electronic Products Foreign Trade Enterprise Website Template 1090 Practical Collection Yiyou template

An eyouCMS responsive website template designed for electronics export enterprises. Its modern, international design style effectively showcases electronic products, technical specifications, export advantages, and global market presence. This template helps electronics companies promote their brands and expand their international business operations. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for eyouCMS | eyouCMS...
👁 57
Responsive Wastewater Treatment Equipment – Foreign Trade Enterprise Website Template 1091

Responsive Wastewater Treatment Equipment – Foreign Trade Enterprise Website Template 1091 Practical Collection Yiyou template

This EyouCMS responsive template is ideal for foreign trade enterprises specializing in wastewater treatment equipment. Its eco-friendly, international design style effectively showcases water treatment equipment products, technical solutions, export advantages, and global market presence, helping environmental protection equipment companies enhance their brand visibility in the international market. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 48
Responsive beauty and skincare product e-commerce enterprise website template – 1092

Responsive beauty and skincare product e-commerce enterprise website template – 1092 Practical Collection Yiyou template

An eyouCMS responsive website template designed for cosmetics and skincare product export enterprises. Its modern, international design style effectively showcases skincare products, brand identity, export advantages, and global market presence. This template helps beauty brands enhance their brand image in international markets and expand their overseas business operations. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for eyouCMS...
👁 51
Resource website typecho001 template

Resource website typecho001 template Program Notes Typecho

typecho001 template template please do not modify the folder name of this template. The folder name is: typecho001 1.4 Fix the js output problem on the article page 1.3 Fix the error prompt when the plug-in is not installed Optimize the list page code output 1.2 Fix the comment function and add a custom homepage title 1.1 Fix the comment reply asymmetry function Add a separate title setting function on the homepage Add the website favicon.ico icon Add one...
👁 198
Responsive Tea Set E-commerce Corporate Website Template 1093

Responsive Tea Set E-commerce Corporate Website Template 1093 Practical Collection Yiyou template

This EyouCMS responsive template is ideal for foreign trade enterprises specializing in tea and tea ware products. Its classical yet international design style effectively showcases tea products, tea ceremony culture, export advantages, and global market presence, helping tea brands convey their cultural heritage to international audiences. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (Ey...
👁 38
Modification of typecho paging style

Modification of typecho paging style Program Notes Typecho

Sir, times have changed! Typecho is currently the most perfect solution, because Baidu can only see the code of fixed thinking. The actual generated HTML code is breathtakingly clean and fully customized, including adding classes to the li element, adding classes to the a element, adding classes to the previous page and next page, and removing the li tags that come with typecho to express more. I can even add some text to the content inside...
👁 517