pstein Posted August 19, 2020 Share Posted August 19, 2020 Assume the following code: <div class="foobar"> "whitespace" <p>....</p> </div> "whitespace" is not the text but a whitespace as indicated in Firefox WebDeveloper. How can I get rid of every whitespace inside after a <div class=foobar"> and the first <p> with Javascript? Link to comment Share on other sites More sharing options...
ishan_shah Posted August 24, 2020 Share Posted August 24, 2020 You can apply css property for that.like margin-left Link to comment Share on other sites More sharing options...
dsonesuk Posted August 24, 2020 Share Posted August 24, 2020 .foobar, .foobar * {display: inline-block; } The reason you would be having what you call whitespace is because the div and paragraph are block elements, meaning they will fill the total width available to it, causing it to stack below any content. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now