How can I solve this styling issues? - css

I have this code, I heard that hspace will be not in use anymore. How can I add space between them on above and between 10px would be good, I tried with margin-top did not worked and broke my other widgets as well.
Here is an example:
Here the code does not have space between them on vertical
This is the wide view here it looks better, once resized into smaller screens I get the above result
I would like to have 10px beween them and when resized on top too.
I want them all in once code, since this is a widget I want it with built in CSS.
<div align="center">
<a href="https://facebook.com/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Facebook.png" align="middle" alt="TestClue on Facebook" height="60" width="60" hspace="10">
</a>
<a href="https://twitter.com/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Twitter.png" align="middle" alt="TestClue on Twitter" height="60" width="60" hspace="10">
</a>
<a href="https://www.linkedin.com/company/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/in.png" align="middle" alt="TestClue on LinkedIN" height="60" width="60" hspace="10">
</a>
<a href="https://plus.google.com/+Testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/G.png" align="middle" alt="TestClue on Google+" height="60" width="60" hspace="10">
</a>
</div>

I would recommend to remove all the inline code that you have on your tags, as some of them got deprecated or are not as useful as the CSS.
I would suggest you to do something like this.
For the HTML:
<div id="social-networks-container">
<div class="social-network">
<a href="https://facebook.com/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Facebook.png" />
</a>
</div>
<div class="social-network">
<a href="https://twitter.com/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Twitter.png" />
</a>
</div>
<div class="social-network">
<a href="https://www.linkedin.com/company/testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/in.png" />
</a>
</div>
<div class="social-network">
<a href="https://plus.google.com/+Testclue">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/G.png" />
</a>
</div>
</div>
And for the CSS:
#social-networks-container .social-network {
display: inline-block;
margin: 10px;
}
#social-networks-container .social-network a {
display: block;
}
An example of this working: https://jsfiddle.net/vfvhqvzf/1/
UPDATE:
If you just want to use inline code on your html you could also try this:
<div style="display:inline-flex;">
<a href="https://facebook.com/testclue" style="display: block;padding: 10px;">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Facebook.png" />
</a>
<a href="https://twitter.com/testclue" style="display: block;padding: 10px;">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/Twitter.png" />
</a>
<a href="https://www.linkedin.com/company/testclue" style="display: block;padding: 10px;">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/in.png" />
</a>
<a href="https://plus.google.com/+Testclue" style="display: block;padding: 10px;">
<img src="http://uhl.hosting/wp-content/uploads/2016/02/G.png" />
</a>
</div>
Demo: https://jsfiddle.net/vfvhqvzf/4/

Maybe you can try this:
padding: 10px;

Add:
style="padding-top:10px;"
to each 'a' (anchor) element

Related

Media Queries not working in my HTML code, Not sure what I am doing wrong here

This is my Code for a FAST click on a website.
Website URL: www.vegastoothdr.com/wp_site/
<body>
<div id="wpadminbar" style="background-color: black; padding-top: 0px;border-color: white;">
<span class="row" style="vertical-align: top">
<!-- PHONE ICON -->
<a href="tel:(702) 473-5100">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/phone.png" width="60" height="36" style="padding-left: 20px">
</a>
<!-- CALENDAR ICON -->
<a href="appointment">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/calendar.png" width="60" height="36" style="padding-left: 20px">
</a>
<!-- EMAIL ICON -->
<a href="contact">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/envelope.png" width="67" height="36" style="padding-left: 20px">
</a>
<!-- PIN ICON -->
<a href="https://www.google.com/maps/place/1070+W+Horizon+Ridge+Pkwy+%23121,+Henderson,+NV+89012,+USA/#36.022368,-115.0346407,17z/data=!3m1!4b1!4m2!3m1!1s0x80c8d16f85764fa7:0x702e5efb00bd1ffb">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/pin.png" width="49" height="36" style="padding-left: 20px">
</a>
</span>
</div>
<header>
<!-- Nav CODE -->
</header>
Okay, Now i have the CODE and I placed a CSS code on the last line on the <head>section
#media screen and (max-width: 782px)
{
div#wpadminbar
{
height: 55px;
min-width: 300px;
}
}
Okay... It works on the mobile device now.
But, The links are not working. So i cant click the icons. none of the links are working.
TEST TWO:
I placed it under the Header Section and the links works.. But the media query is not working. Soo weird.
I have placed the code below where the links are working but the media query is not working.
<body>
<header>
<div id="wpadminbar" style="background-color: black; padding-top: 0px;border-color: white;">
<span class="row" style="vertical-align: top">
<!-- PHONE ICON -->
<a href="tel:(702) 473-5100">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/phone.png" width="60" height="36" style="padding-left: 20px">
</a>
<!-- CALENDAR ICON -->
<a href="appointment">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/calendar.png" width="60" height="36" style="padding-left: 20px">
</a>
<!-- EMAIL ICON -->
<a href="contact">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/envelope.png" width="67" height="36" style="padding-left: 20px">
</a>
<!-- PIN ICON -->
<a href="https://www.google.com/maps/place/1070+W+Horizon+Ridge+Pkwy+%23121,+Henderson,+NV+89012,+USA/#36.022368,-115.0346407,17z/data=!3m1!4b1!4m2!3m1!1s0x80c8d16f85764fa7:0x702e5efb00bd1ffb">
<img class="icons" src="http://www.vegastoothdr.com/wp_site/wp-content/uploads/2016/03/pin.png" width="49" height="36" style="padding-left: 20px">
</a>
</span>
</div>
I fixed the issue, There was JS script that was adding a Div for Video. It seems the DIV was on top on my code.
I deleted it and it fixed it :)
Link to the site: http://www.vegastoothdr.com/

change image on hover moves images

I'm having a bit of problem here.
I'm trying to display an image in a circle div (using bootstrap), that when hover, the picture becomes a gif, but if you take your mouse from over the picture, it is only a static image.
It works, almost, as it moves the picture and the frame around, and I can not find why.
Here it is http://jsfiddle.net/eve_mf/zmp7tnho/
<div class="container">
<div class="titleColumns col-md-24">
<h1>Meet Some Of <strong>Our Denison Experts</strong></h1>
<h2>We can have a line about the team</h2>
<div class="personPic col-md-6">
<div class="circleFrame"><img class="static img-circle alignleft wp-image-1008 size-full" src="http://motors06.denison-automotive.co.uk/denison/wp-content/uploads/2015/05/jules_sil5.png" alt="" width="120" height="120" />
<img class="animated img-circle alignleft wp-image-1008 size-full" src="http://motors06.denison-automotive.co.uk/denison/wp-content/themes/denison-automotive/images/jules_sil_gif.gif" alt="" width="120" height="120" /></div>
<span class="peopleName">Jules Perry</span>
<span class="peoplePos">The Thinker</span>
</div>
<div class="personPic col-md-6">
<div class="circleFrame"><img class="static img-circle alignleft wp-image-1012 size-full" src="http://motors06.denison-automotive.co.uk/denison/wp-content/uploads/2015/05/tessa_sil2.png" alt="" width="120" height="120" />
<img class="animated img-circle alignleft wp-image-1012 size-full" src="http://motors06.denison-automotive.co.uk/denison/wp-content/themes/denison-automotive/images/tessa_sil_gif.gif" alt="" width="120" height="120" /></div>
<span class="peopleName">Tessa Denison</span>
<span class="peoplePos">The Creative</span>
</div>
</div>
</div>
I'm just working with html and css
Any suggestions? I've tried to remove all the styles but even then, there is a movement between the pictures and are the same size..
Thank youuuu
In fact, you don't need to set a position at all.
.circleFrame:hover .animated {
display:block;
}
http://jsfiddle.net/zmp7tnho/4/
I recommend you to set border styles to circleFrame too - http://jsfiddle.net/d3z849y7/
It helps you with freezing borders.

Can't figure out why :nth-of-type won't work

I'm trying to select every 4th image in my div gallery. I can't seem to figure out why I can't select it.
#gallery img:nth-of-type(4n){
border: 5px solid #000;
}
I've tried a few other ideas but to no success. Can anyone help me and explain to me why this isn't selecting every 4th image in my div gallery? Thanks in advance.
<div id="gallery">
<a href="/system/images/series_uploads/5/original/ankara_5602p_alabaster.jpg?1330114093" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/5/gallery/ankara_5602p_alabaster.jpg?1330114093" title="Ankara" />
<div class="gallery-text">
<h3>Ankara</h3>
<p>Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/6/original/ankara_5624p_noce.jpg?1330114095" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/6/gallery/ankara_5624p_noce.jpg?1330114095" title="Ankara" />
<div class="gallery-text">
<h3>Ankara</h3>
<p>Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/7/original/ashton_23931_smokey_beige_.jpg?1330114250" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/7/gallery/ashton_23931_smokey_beige_.jpg?1330114250" title="Ashton" />
<div class="gallery-text">
<h3>Ashton</h3>
<p>Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/8/original/ashton_23942_camel_haze_entry.jpg?1330114251" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/8/gallery/ashton_23942_camel_haze_entry.jpg?1330114251" title="Ashton" />
<div class="gallery-text">
<h3>Ashton</h3>
<p>Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/9/original/ashton_23942_camel_haze_lr.jpg?1330114252" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/9/gallery/ashton_23942_camel_haze_lr.jpg?1330114252" title="Ashton" />
<div class="gallery-text">
<h3>Ashton</h3>
<p>Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/10/original/berkshire_25525_oak.jpg?1330115116" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/10/gallery/berkshire_25525_oak.jpg?1330115116" title="Berkshire" />
<div class="gallery-text">
<h3>Berkshire</h3>
<p>HDP – High Definition Porcelain</p>
</div>
</a>
<a href="/system/images/series_uploads/11/original/berkshire_25585_walnut_famousdaves01.jpg?1330115118" rel="lightbox['gallery']">
<img alt="" src="/system/images/series_uploads/11/gallery/berkshire_25585_walnut_famousdaves01.jpg?1330115118" title="Berkshire" />
<div class="gallery-text">
<h3>Berkshire</h3>
<p>HDP – High Definition Porcelain</p>
</div>
</a>
</div>
they aren't siblings that's why you should use
#gallery a:nth-of-type(4n) img{
border: 5px solid #000;
}

Floating issue with multiple images inside one p tag

http://boythemovie.co.nz/wordpress/downloads-2
Thanks to WP formatting, the images with captions sit in their own divs, whilst the others are all within a single <p> tag.
What I would like is for all the images, with or without captions, to flow nicely.
For now I have:
HTML - which I can't change:
<div style="width: 250px" class="wp-caption alignnone" id="attachment_158">
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/WaihauBay.jpg">
<img width="240" height="159" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/WaihauBay-240x159.jpg" title="WaihauBay" class="size-medium wp-image-158 ">
</a>
<p class="wp-caption-text">
Caption text goes here
</p>
</div>
<p>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/1011.jpg">
<img width="240" height="160" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/1011-240x160.jpg" title="1011" class="alignnone size-medium wp-image-162">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/1062.jpg">
<img width="240" height="159" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/1062-240x159.jpg" title="1062" class="alignnone size-medium wp-image-164">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/1064.jpg">
<img width="240" height="160" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/1064-240x160.jpg" title="1064" class="alignnone size-medium wp-image-166">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/521.jpg">
<img width="240" height="160" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/521-240x160.jpg" title="521" class="alignnone size-medium wp-image-168">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/519.jpg">
<img width="240" height="160" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/519-240x160.jpg" title="519" class="alignnone size-medium wp-image-170">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/507.jpg">
<img width="240" height="360" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/507-240x360.jpg" title="507" class="alignnone size-medium wp-image-171">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/508.jpg">
<img width="240" height="360" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/508-240x360.jpg" title="508" class="alignnone size-medium wp-image-172">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_1.jpg">
<img width="240" height="159" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_1-240x159.jpg" title="BOY_1" class=" alignnone">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_3.jpg">
<img width="240" height="311" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_3-240x311.jpg" title="BOY_3">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_2.jpg">
<img width="240" height="158" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_2-240x158.jpg" title="BOY_2" class="alignnone size-medium wp-image-175">
</a>
<a href="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_5.jpg">
<img width="240" height="160" alt="" src="http://boythemovie.co.nz/wordpress/wp-content/uploads/BOY_5-240x160.jpg" title="BOY_5" class="alignnone size-medium wp-image-177">
</a>
</p>
CSS:
.wp-caption {
float: left;
}
#content img {
float: left;
}
Any help in understanding how floated elements work in this case would be greatly appreciated!
Floated elements should normally be used to wrap text around a certain element, for instance, your image. From my estimates of your question, you are trying to position caption for an image so that the position of other images are not disturbed.
Why not use the display:inline-block property. In that manner you can have plenty of such parent div enclosing n number of elements without affecting the position of elements outside this div
It can be summarized as follows.
<div id="theGlobalDiv">
<div id="withCaption" style="display:inline-block" >
<img src="image.jpeg" />
<p id="caption">Some caption inserted here</p>
</div>
<div id="withoutCaption" style="display:inline-block" >
<img src="image2.jpeg" />
</div>
</div>
Hence, display:inline-block will display withCaption and withoutCaption in one line but the elements inside them will be on successsive lines. NOTE that inline-block works only when elements using this property are inside another block level element. Hence, if you try to enclose div inside a p or two or more divs as ultimate parent elements, set to this property, then it will fail to achieve the desired flow

Cufon h2 on div hover

I have h2 tags inside divs which I need to change colour on div hover, if the cufon is turned off, the h2 tag changes colour fine, but when cufon is turned on, it doesn't change colour. Here's my code:
Cufon
Cufon.set('fontFamily', 'DIN');
Cufon.replace('.listing_04 li a .bx1 .right .head_bx h2', {
hover: true,
hoverables: { a: true, div: true }
});
CSS
.listing_04 li a .bx1 .right .head_bx h2 {
color: #e91397;
font-size: 16px;
padding: 0px;
margin: 0px;
}
.listing_04 li a:hover .bx1 .right .head_bx h2 {
color: #ffff00;
}
Code
<div class="listing_04">
<ul>
<li> <a href="#">
<div class="bx1">
<div class="left"> <img src="images/friends_only.jpg" alt="" border="0" class="img_border01" />
<div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div>
</div>
<div class="right">
<div class="head_bx">
<h2><strong>The Party Girls</strong></h2>
My Favourites</div>
<p> By : <b>Modi</b><br />
19 Jan 2010 # 20:20<br />
Views : <strong>1542484</strong><br />
Comments : <strong>84 </strong></p>
</div>
<div class="clear"></div>
</div>
</a> </li>
<li> <a href="#">
<div class="bx1">
<div class="left"> <img src="images/img_07.jpg" alt="" border="0" class="img_border01" />
<div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div>
</div>
<div class="right">
<div class="head_bx">
<h2><strong>The Party Girls</strong></h2>
My Favourites</div>
<p> By : <b>Modi</b><br />
19 Jan 2010 # 20:20<br />
Views : <strong>1542484</strong><br />
Comments : <strong>84 </strong></p>
</div>
<div class="clear"></div>
</div>
</a> </li>
<li> <a href="#">
<div class="bx1">
<div class="left"> <img src="images/resticted_image.jpg" alt="" border="0" class="img_border01" />
<div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div>
</div>
<div class="right">
<div class="head_bx">
<h2><strong>The Party Girls</strong></h2>
My Favourites</div>
<p> By : <b>Modi</b><br />
19 Jan 2010 # 20:20<br />
Views : <strong>1542484</strong><br />
Comments : <strong>84 </strong></p>
</div>
<div class="clear"></div>
</div>
</a> </li>
</ul>
<div class="clear"></div>
</div>
Example URL: http://dev.splished.360southclients.com/test.php In this test I've disabled cufon for you to see that the h2 colour change works when you hover over the .bx1 div, click "turn cufon on" to see it with the cufon.
You don't need to use jquery. You just weren't properly setting the color. Try this:
Cufon.replace('.listing_04 li a .bx1 .right .head_bx h2', {
hover: {
color: 'yellow'
},
hoverables: { a: true, div: true }
});
By using the hoverables setting you will be able to add the hover effect to as many elements as you like.
I managed to get it working using jQuery, here is what I have done to fix this issue, if anyone else is having this problem:
/* jQuery and Cufon for div hover */
$(".bx1").hover(function() { //handlerIn
//change the colour
var h2 = jQuery(this).find("h2");
Cufon.replace(h2, {
color: '#ffff00'
});
}, function() { //handlerOut
//revert the colour
var h2 = jQuery(this).find("h2");
Cufon.replace(h2, {
color: '#e91397'
});
});

Resources