使Jekyll img比文字更宽? [英] Making Jekyll img's wider than the text?
问题描述
对于我的Jekyll博客,我想要的图像跨越列的整个宽度,同时在文本的任一边填充,像这样: http://www.webdesignerdepot.com/2015/05/the-ultimate-guide-to-web-animation
我遇到的主要问题是Jekyll在< p>
标记中包装图片,因此没有(我知道),以指定图片的宽度,而不是段落。
< p&
一些文本。
< / p>
< p> < img src =#> < / p>您将如何建议解决这个问题?
h2_lin>解决方案我认为戴维兹的回答真的很好。但是,如果你没有使用jQuery解决这个问题,你可以这样做:
$('。content> p> ; img')。parent()。css('padding','0');
这样你的降价就会保持干净。
For my Jekyll blog, I want the images to span the whole width of the column, while having padding on either side of the text, like this: http://www.webdesignerdepot.com/2015/05/the-ultimate-guide-to-web-animation
The main problem I'm having is that Jekyll wraps images in <p>
tags, so there's no way (that I know of) to target the width of images without and not the paragraphs.
<p>
"Some text."
</p>
<p> <img src="#"> </p>
How would you suggest tackling this issue?
解决方案 I think Davids answer is really good. However, if you have no problem solving this with jQuery, you can do this:
$('.content > p > img').parent().css('padding','0');
That way your markdown will stay clean.
这篇关于使Jekyll img比文字更宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!