Will p respond to margin? |
Will p respond to margin? |
Mhatfield |
Jul 22 2015, 04:01 AM
Post
#1
|
Novice Group: Members Posts: 29 Joined: 22-July 15 Member No.: 23,063 |
It worked as you said it would, but I want some margin between 'Status' and the photo.
Here I tried using margin-left: 10px; it availeth none. |
Frederiek |
Jul 22 2015, 04:07 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
That's because an image is an inline element, while a P is a block-level element. Inspect both elements, you'll see how they render.
You could add a margin-right to the image instead. |
Mhatfield |
Jul 22 2015, 04:09 AM
Post
#3
|
Novice Group: Members Posts: 29 Joined: 22-July 15 Member No.: 23,063 |
i suspected it was something among those lines…lol
All this block level, inline, stuff = confusing lol |
Mhatfield |
Jul 22 2015, 04:10 AM
Post
#4
|
Novice Group: Members Posts: 29 Joined: 22-July 15 Member No.: 23,063 |
Ok thanks it worked!
|
pandy |
Jul 22 2015, 04:19 AM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Actually it is because the image is floated. Floats push the content of adjacent boxes away, but not the box itself. The P stretches behind the floated image all the way to the left edge of the page. For a left margin to have a visible effect it must be wider than the image.
|
Mhatfield |
Jul 23 2015, 01:57 AM
Post
#6
|
Novice Group: Members Posts: 29 Joined: 22-July 15 Member No.: 23,063 |
Ok thanks so much! Learn something everyday
|
pandy |
Jul 23 2015, 04:02 AM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Ha ha! Now I'm banned from your site! Or blacklisted anyway.
Anyhow, put something like this on the P and you can see how it works, how the P streches and that if that you add a small left margin it only affects how far to the left the P box stretches. CODE <p style="border: 10px solid red; margin-top: -5px"><u><b>Status:</b></u>Currently working on my website (this site). Playing basketball and working with my horses. </p> |
Lo-Fi Version | Time is now: 24th April 2024 - 12:14 PM |