+ 1
why margin-bottom or padding bottom doesn't work?
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> a { display: inline-block; } img { width: 50px; display: inline-block; } span { display: inline-block; margin-bottom: 20px; padding-bottom: 20px; } </style> </head> <body> <a href=""> <img src="https://www.logologo.com/logos/tree-logo.jpg" alt="Logo"> <span>My Website</span> </a> </body> </html>
4 Antworten
+ 3
// It's working but not visible because background color is white, Give background color to span and you can see
https://code.sololearn.com/W12nywuAZJod/?ref=app
//Note: i will delete this private code is 24h please copy if you want
+ 1
Set
vertical-align: bottom;
on span tag
0
Sudarshan Rai 👑 yeah i know it works. but why i can't put it up with margin or padding bottom?
0
margin-top and margin-bottom doesn't work on non-replaced elements like <span>