I added “add to cart” button image over which I have put a link to checkout, image is located on top of my product description but spacing between image and text is too great is there any way to decrease it? Perhaps with CSS?
How “add to cart” button looks now:
and how I would like for it to look like:
Here is my code in the product description for the image/visual above:
<img class="alignnone size-full wp-image-623" src="http://example.com/wp-content/uploads/2018/03/addtocart1-2.jpg" alt="" width="383" height="70" />
<ul>
<li>FREE WORLDWIDE SHIPPING</li>
<li>Delivery time: 9 to 18 days</li>
</ul>
Update:
Bottom margin is definitely a source of problem. I'm using SiteOrigin CSS plugin to edit my css but Konards code (answer below) is not working as expected, you can see how it looks with Konards code and when I uncheck bottom margin with inspect element (text is deformed as well even when I delete text part of the code).
And here you can see how the code looks before and after it's saved in SiteOrigin CSS (got some errors as well).
And here is the code (begins at line 10)
Can you send image how it looks on website?
I tried do it with CSS:
<img class="alignnone size-full wp-image-623" src="(your image url)" alt="" width="383" height="70" />
<ul>
<li>FREE WORLDWIDE SHIPPING</li>
<li>Delivery time: 9 to 18 days</li>
</ul>
<style>
img {
margin: 0;
margin-bottom: 0 !important;
}
li,
ul {
margin: 0;
margin-bottom: 0 !important;
line-height: 8px !important;
}
</style>
Related
I use wordpress and want to add social media icons to my footer. What I did so far is to add the following code to the footer.php:
<div id="social-buttons">
<a href="http://twitter.com/veda_vit" rel="me"><img title="veda-vit.de bei Twitter" src="http://veda-vit.de/wp-content/uploads/2017/11/Twitter.svg" alt="Twitter Button" width="24" height="24" />
</a>
<a href="https://www.facebook.com/vedavit.de" rel="me"><img title="veda-vit.de bei Facebook" src="http://veda-vit.de/wp-content/uploads/2017/11/Facebook.svg" alt="Facebook Button" width="24" height="24" />
</a>
</div>
And additionally I added the following css code to place the icons on the right:
#social-buttons a img {
margin: 10px 12px 0 0;
float: right;
}
It works so far, but the icons are placed on a second line (see here: www.veda-vit.de).
What can I do to place the copyright and the icons on one line? I tried already everything, but couldn't solve the problem. Can anybody help me, please?
Thank you!
You can add this CSS code and it will work nicely
#social-buttons {
float: right;
position: relative;
top: -9px;
}
You can edit it more by changing top position.
When we insert a image to blogger post it automatically inserts a separator with 'text-align:center;'. I want to remove it(and set it to left instead of center). But it's hard to remove it manually for every image in every post. Is there a easy way to do this automatically?
I tried .post-body img{float:left;} template CSS. This gets the image to left, but then texts flow to right side of the image instead of under the image. Please help me to do this.
Edit: Below is the normal div that an image would be automatically surrounded when a image is added to a blogger post. Below that is the texts of post.
<div class="separator" style="clear: both; text-align: center;">
<a href="-----.html"; imageanchor="1" style="margin-left: 0em; margin-right: 1em;">
<img alt="" border="0" src="1.bp.blogspot.com/1.JPG"; title="" />
</a></div>
<br/>
<span style="font-size: large;">text paragraph texts texts</span><br />
Within the <b:skin> or in a separate <style> within the <head> of your template include the following CSS code:
.post-body .separator {
text-align:left !important
}
I can't see the rest of your code, if you uploaded something like a js.fiddle that would help! The code below should fix the text alignment with your images, if it doesn't let me know!
.post-body img {
float: left;
text-align: left;
}
.post-body .separator a {
margin: 0!important;
}
Something is definetly wrong with my ul and li. I know I made a huge mistake but I cannot find it. When you go here:
http://icpy.webs.com/text/Mass.htm
You will see both thumbnail images are different but both pop ups have the same bigger image as the first thumbnail.
Why are these before doctype? What are those custom elements?
<link rel="stylesheet"type="text/css"href="../text/aboutleft.css">
<img src="http://icpy.webs.com/content/masslayout.png"/><br>
____________________________________________________________________________<br><br>
<x><re>colors available</re></x><br>
<x><gre>available to unlimited users </gre></x><br>
<x>Changes available: box, link, username</x><br><br>
Why don't you use a relative link for the masslayout.png?
Have you ever heard of the <hr> element in HTML?
I don't see any thumbnails, neither popups and I don't know what you are talking about.
jQuery is stored on Google and it is in cache for most of the users. Why do you store and link another one?
Your CSS:
.fancybox-custom .fancybox-skin {
box-shadow: 0 0 50px #222;
}
body {
max-width: 700px;
margin: 0 auto;
#cas ul {
list-style-type: none;
}
}
What is this?? What did you want?
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe>
Href attribute needs a close quote mark.
Look at your source code and after that into the inspector and please correct as many errors as you can.
I think the reason it's like that, because both boxes are within the same <a>-Tag, which of course links to only one of the big images:
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe">
<img src="http://dgamerhelp.webs.com/soccer/layouts/BEA01.png"/>
<div id="inlineframe" style="width: 1040px; height: 785px; display: none;">
</div>
</a>
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe">
<img src="http://dgamerhelp.webs.com/soccer/layouts/JAK01.png"/>
<div id="inlineframe" style="width:1040px;height:785px;display: none;">
</div>
</a>
This is Wordpress-related question, but since desired solution is purely CSS-related, I posted it in here, not at wordpress.stackexchange.com.
In my current style, if image has no following caption, it is placed using HTML code like that:
<p>
<a href="http://cnn.com/file.jpg">
<img src="http://cnn.com/file-300x225.jpg" alt="" width="300" height="225" class="aligncenter size-medium wp-image-55">
</a>
</p>
In my current style, it is styled like that:
img {
display: block;
padding: 5px;
background-color: #eee;
border: 1px solid #ddd;
}
Which draws simple border around it.
If there is a caption following image, entire HTML in this part is a little bit more complex:
<div id="attachment_55" class="wp-caption aligncenter" style="width: 310px">
<a href="http://cnn.com/file.jpg">
<img src="http://cnn.com/file-300x225.jpg" alt="" width="300" height="225" class="size-medium wp-image-55">
</a>
<p class="wp-caption-text">Caption</p>
</div>
Currently caption is not styled at all (as per my currently selected theme).
What I would like to achieve is to have entire div styled (image and caption), if there is any caption. If I'm not mistaken, that would require to style img (as currently) only, if it is not followed by <p class="wp-caption-text">. If it is, then img should not be styled at all and it second-in-row parent (<div class="wp-caption">) should be styled instead.
That's all for the algorithm. But how to code this in CSS (and whether it is possible at all) -- I don't know.
The simpliest solution would be to never style img and always style <div class="wp-caption"> instead, no matter if there is caption following image or not. But the problem is, that Wordpress is adding that div only, if there is a caption. So styling only it, would result in no border at all, if there is only image.
if you can use Jquery.
you can manipulate the markup then. if the pattern of your img and img with caption is going to be like that, you can do this.
$('img').each(function(){
if($(this).parent().parent().hasClass("wp-caption")){
$(this).parent().parent().addClass('img');
}
});
am sure this code can be optimized even better, but it should give you an idea.
see this fiddle
I have a small Perl script the loads some external images to page. The images links (50 of them) are all within an array which I iterate through to dump to screen. While I am reasonably good at Perl I have never done any web dev before so I am a complete noob with CSS. I have the following code in the html template
[% FOREACH dvd IN dvd_chart %]
<div class="thumbnail">
<img src="[% dvd.thumbnail %]" />
<br>
</div>
[% END %]
The CSS is this:
.thumbnail
{
float: left;
width: 120px;
border: 1px solid #999;
margin: 0 15px 15px 0;
padding: 5px;
}
EDIT:
Generated HTML looks like this:
<div class="thumbnail">
<img src="http://content9.flixster.com/movie/11/16/78/11167831_pro.jpg" />
<br>
Taken 2
</div>
<div class="thumbnail">
<img src="http://content9.flixster.com/movie/11/16/86/11168615_pro.jpg" />
<br>
The Possession
</div>
<div class="thumbnail">
<img src="http://content7.flixster.com/movie/11/16/80/11168037_pro.jpg" />
<br>
Won't Back Down
</div>
<div class="thumbnail">
<img src="http://content9.flixster.com/movie/11/16/51/11165143_pro.jpg" />
<br>
To Rome with Love
</div
The problem is the images start to load perfectly, the first two rows are fine, but then there will be a few rows with just one image, followed by more good rows. There are no missing URLs. Can anyone suggest what might be going wrong or even a good tutorial for loading dynamic images into div -that wraps!
I took a look at your HTML and CSS in a JS fiddle, and I saw right away that it's an issue with the height of any item with a longer movie title. A quick Google search for "CSS gallery variable height" brings up this tutorial: http://jonathanweatherhead.com/2012/12/31/how-to-make-a-flowing-css-gallery-layout/
I would follow that. Otherwise, you may have to set a height for all gallery items (not the best plan) or limit the length of the movie titles (also not great).