Table Of Content
- Given this HTML & CSS:
as a result, there will be a 4px wide space between the SPAN elements.
- We could get rid of that space by removing the white-space between the SPAN elements in the HTML source code:
- In JavaScript – by removing the Text nodes from the container element (the paragraph), will be shown like this:
- Add comments between elements NOT to have a white space.
- Use flexbox :
- Add display: flex; to the parent element.
simple:
- no need to touch parent element.
- Only condition here: the item’s font-size must not be defined (must be equal to parent’s font-size).
- 0.25em is the default word-spacing
- This is one of the solution :
- If you want to make two pinkspan without a gap or other white-space, but if you want to remove the gap,
- Can try the flexbox and apply the code below and the space will be removed.
CSS solution :
Add white-space: nowrap to the container element ;
css :
Html :
- Remove the spaces from Inline Block Elements there are many method:
