Pep
Pep

Reputation: 677

&nbsp when inspecting the element?

When I inspect the element in Chrome dev tools I see the following

Why do I see this element? &nbsp and how can I remove it?

<div>Word1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>

Upvotes: 0

Views: 826

Answers (2)

Ethicist
Ethicist

Reputation: 827

&nbsp represents the non-breaking space entity.

Here's an excerpt from the MDN docs on entities:

Entities are frequently used to display reserved characters (which would otherwise be interpreted as HTML code), and invisible characters (like non-breaking spaces). You can also use them in place of other characters that are difficult to type with a standard keyboard.

Upvotes: 1

craftecode
craftecode

Reputation: 21

&nbsp; means 'Non-Breaking Space'. In a WYSIWYG (What you see is what you get) text editor you can just press space a bunch of times to get a larger space. But in HTML it would just read multiple spaces as one. So that code you pasted should show as "Word1      ".

Upvotes: 2

Related Questions