• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Double border makes the div larger

Resolved: Double border makes the div larger

0
By Isaac Tonny on 04/04/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Double border makes the div larger

Question:

I’m using React and Tailwind, I want to achieve this :
Goal input
So I added a border on both button + and -, and I added a border on the parent div to display a border on all the element.
Problem is, the borders on buttons seemes to be larger because of the 2 borders.
If I use a border only on the right for – button, we can see it misses a little pixels with no border…
How can I achieve it ?
Here is a Tailwind Playground
Here is my code :
Thank you !

Best Answer:

If I use a border only on the right for – button, we can see it misses a little pixels with no border…


Actually it is not missing any pixels , it seems to be faded because of the rounded border.
Feasible solution:
  1. Remove rounded from the + and - divs
  2. Apply only left and right border to the respective divs.

Updated Code:
Output:
enter image description here
Tailwind-play

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

css reactjs tailwind-css
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to stop a thread that has a blocking function from easygui in python

05/04/2023

Resolved: Removing null keys from a json array of objects

05/04/2023

Resolved: How can I generate at compile-time a separate OpenAPI Swagger.json file for each Controller in my ASP.NET project?

05/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.