简体   繁体   中英

Keep same icon size with flex box responsive

I have a problem with my tuner, I try to keep the same size arrow, but when I reduce the resolution the arrow becomes smaller

<div className="shadow rounded my-5">
            <div onClick={() => toggle(index)} key={index} className="bg-[#8e9fbc] rounded text-white font-bold flex justify-between items-center cursor-pointer p-5">
        <span>{item.question}</span>
        {clicked === index ? (<ChevronDownIcon className="w-6 "/>) :<ChevronRightIcon className="w-6  "/>}
        
        </div>
       {clicked === index ? (<div className="p-5"> {item.reponse}</div>) : null} </div>

在此处输入图像描述

Can you help me? Thank you!

Simply apply flex-shrik: 0; to the icons, this prevent them from getting smaller.

Note that you should have width for those icons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM