Text with no blank space at top of a div


Whenever I write text in a div it leaves a line of blank space before starting the text.

How do I move the text up to start at the top of a div.



Do you wrap the text in a <p>? Might be the default margins. Try setting them to 0.

You do raelize we are shooting in the dark here though, yes? You are forcing us to guess with no code or website :slight_smile: .

This code works but when you start another paragraph it does not leave a line-space (when you want one).

	font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000000;
margin:0px 0px 0px 0px;


That’s not enough code to go off of.

Please give us a re-createable problem. HTML and CSS.

As Ryan said we are shooting in the dark a bit but it may be that you don’t realise that elements like p,ul,ol,headings (and some others) have a default top margin in most browsers.

You need to reset this to something suitable for your own use.


p{margin:0 0 1em}

That will remove the top margin but add the bottom margin which is what you usually want.

1 Like


That has solved the problem. Thank You.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.