How can I remove unwanted left margin/padding from

2019-09-16 11:25发布

I'm fairly new to the whole HTML and CSS thing, so apologies in advance for my cluelessness! I've been trying and failing to align my post images with my text on my blog:http://kittenasacat.blogspot.ie/2013/08/saturday-sweetness-my-caramel-squares.html The content body is 600px wide and so are my pictures, but they are being slightly indented so that the right side of them is cut off a little. I've successfully managed to get everything else in line, but not these!

.post{
  width:100%;
  height:auto;
  padding:0;
  margin:5px 0 30px;
  border-bottom:none;
}
.post-body{
  margin:0 0 .75em;
  line-height:1.6em;
  font-size:11px;
  font-family:Arial;
  text-align:justify;
}
.post h3{
  font-size:30px;
  margin:0;
  padding:5px 0;
  text-align:left;
  font-family:Yanone Kaffeesatz, sans-serif;
  text-transform:uppercase;
}
.post img{
  padding:0;
  min-width:600px;
}
.thumbs img{
  margin-left:0px;
}
.post-footer-line-1,.post-footer-line-2,post-footer-line-3,.post-footer{
  display:none;
}

I'd say this is probably something obvious, but it beats me. Let me know if you need more information! Thank you so much in advance for your help! (:

3条回答
淡お忘
2楼-- · 2019-09-16 11:38

looking at your website, I found an a-tag around the image with inline styles:

<a href="[...]" style="margin-left: 1em; margin-right: 1em;">
    <img border="0" src="[...]">
</a>

Thus, just removing the inline styles will also remove the margins :)

查看更多
男人必须洒脱
3楼-- · 2019-09-16 11:59

I think this style setting is your problem ...

style="margin-left: 1em; margin-right: 1em;"

When I turned them off the image moved to the right and the cut off part appeared.

查看更多
时光不老,我们不散
4楼-- · 2019-09-16 12:01

style="margin-left: 1em; margin-right: 1em;" can be fixed to none. See the post for detail.

查看更多
登录 后发表回答