- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi,
Im having a margin below my image, and Im not understanding why.
I have my example here:http: http://jsfiddle.net/kembwo4j/3/
And as you can see I have a white space (margin) below my image, do you see why I have this space there?
Set the border-bottom: none;
like so:
.modal .img {
width:200px;
height:220px;
float:left;
margin-right:10px;
border:5px solid #f3f3f3;
border-bottom:none;
}
But I would pull it down little bit, like this:
.modal .img {
width:200px;
height:220px;
float:left;
margin: 10px 10px 5px 0px;
border:5px solid #f3f3f3;
border-bottom:none;
}
Thanks for your answer Alen.
But why I need to give a margin-top to my image to not have white space below it?
Im really not understanding this!
The value is most likely inherited from the browser, meaning the browser decides what the margin should be if it’s not declared.
Ah ok Allen, thanks for the information and help.
One last question, with your code solution, my text goes up and stays a bit above my picture. But if I set a margin-top for my pagraph text, I have again some white space below my image..lol!
Do you see how I can fix this?
Thanks for your answer Soronbe! But I really dont want that white space below my image, you have other idea to fix this?
The issue is not with the margin, like Soronbe said text is really the issue.
Look at the darker orange line it shows the actual margin.
Granted there is no bottom margin – adding box-sizing: border-box
to the img will solve this