Removing horizontal gap between image tags HTML/CSS -
this question has answer here:
i practicing html , css , ran annoying problem. wondering horizontal gap , how remove it?
thanks in advance
<!doctype html> <html lang="en"> <head> <title>practice</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta content="text/html;charset=utf-8" http-equiv="content-type" /> <meta content="utf-8" http-equiv="encoding" /> <style> html,body { margin:0; padding:0; height:100%; } </style> </head> <body> <script src="./js/jquery.js"></script> <img id="sample-img" src="green-nature-wallpaper.jpg" style="margin:0; padding:0;"></img> <img id="sample-img2" src="green-nature-wallpaper.jpg" style="margin:0; padding:0;"></img> <script> $( document ).ready(function () { $("#sample-img").width($(window).width()); $("#sample-img").height(0.6*$(window).height()); $("#sample-img2").width($(window).width()); $("#sample-img2").height(0.6*$(window).height()); }); $(window).resize(function() { $("#sample-img").width($(window).width()); $("#sample-img").height(0.6*$(window).height()); $("#sample-img2").width($(window).width()); $("#sample-img2").height(0.6*$(window).height()); }); </script> </body> </html>
have tried setting image margin , padding 0?
<style> img { position:relative; display:block; margin:0; padding:0; } </style>
Comments
Post a Comment