Margin-right not working

I’ve been building a page and stumbled across a weird problem. For some to me unknown reason, margin-right doesn’t work properly on my #txt div. Can anyone take a look and try to figure out what’s wrong?
Here’s the code

What are you trying to do with it? If I set the margin-right to something like 300000px it pushes everything to the right. I also tested margin: 30px 30px; and all the margins worked for me?

Unless you are trying to make your nav have a margin-right to keep it away from the wall? In which case it doesnt appear to have the id of #txt.

I’m trying to make the text after the paw a little farther from the paw. But when I set margin-right:10px nothing happens.

You should use margin-left

Those elements are as flush to the right as possible, so If you try moving the paw to the left using margin-right nothing will change.

1 Like

This seems to work but I’m really confused now. Isn’tmargin-right supposed to determine how much space is the element going to have between itself and the neighboring element to it’s right?

I think the easier way is to make simple examples, take a look here (and set up margins :slight_smile:)

Tried to polish this a bit:

  • margin is part of the box model
  • margin left 30px adds/appends a rectangle on the left of the box.
  • Same thing for the other margins.
1 Like

Thanks man, I realised that I managed to forget which way is right :man_facepalming:

1 Like