How to generate separators between buttons inside a search box in CSS

How to generate separators between buttons inside a search box in CSS



I have a input search box which has two buttons on the right end of the search box. In future I would be adding more buttons on the right. So I am thinking of auto generating the button separators whenever a button has another button on its right side. Is this possible to be done only with CSS?



Currently I am only generating the button separator as a small little pip between two buttons using the following css rules. But this is specific to the RESET button only. I have another button named "search button" next to the reset button. Now if I add a new button name "Image button", I need to have a separator auto generated. I didn't want to have a separate div for the separators. Is it possible?


div


.search-field__reset-button::after
position: absolute;
right: 0;
height: 1.5rem;
content: '';
border-right: 1rem solid black;






give them all a common class and then use last child to remove the border of the last button or leave that class off the last button

– Pete
Sep 13 '18 at 9:27







@Pete solid, simple and clean. OP please do this! Please consider forming an answer with that solution

– user10004359
Sep 13 '18 at 10:12





1 Answer
1


button
color:red;


button + button
margin-left:20px;



try this






this will work when you will have button after button

– midnightgamer
Sep 13 '18 at 10:09






While this code snippet may solve the question, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.

– Clijsters
Sep 13 '18 at 11:50



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ