Cufon h2 on div hover - css

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'
});
});

Related

How can I solve this styling issues?

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

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/

The scroll bar disappears - CSS

My problem is that when I re-size the browser window, instead of allowing the user to scroll in the horizontal direction, they simply disappear. As you can see, I have a div called product list, and my aim is to add a scroll bar when they do not fit on the screen. However, I still want avoid using the scroll bar for the entire page.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
border: 0px;
overflow-y:hidden;
}
.productList {
overflow-x: scroll;
overflow-y:scroll;
position:fixed;
height:75%;
min-width:3000px;
max-width:5000px;
}
.header
{
height:10%;
border-bottom: 1px groove black;
font-size:100px;
font-family:Verdana;
}
.menu {
width: 800px;
/* border-top-style: groove;*/
/*border-bottom-style: groove;*/
/*border-bottom-color: Black;*/
font-family: Georgia;
border:2px groove black;
border-left:0px;
height:4%;
}
.menuitem {
/*/border-top: 1px groove black;*/
border-bottom: 1px groove black;
text-decoration: none;
display: inline-block;
text-align: center;
padding: 4px;
cursor: pointer;
background-color: White;
color: Black;
font-weight: bold;
}
.menuitem:hover {
/*/border-top: 1px groove black;*/
border-bottom: 1px groove black;
text-decoration: none;
display: inline-block;
text-align: center;
padding: 4px;
cursor: pointer;
background-color: #505050;
color: White;
font-weight: bold;
}
.product
{
display:block;
width:200px;
float:left;
}
.logo {
width: 200px; /*should be the same as product width*/
height: 100px; /*was 100px*/
position: fixed;
background-color: white;
display: block;
/*margin-bottom:100px;*/
}
.logos
{
width:1400px;
}
.search
{
height:11%;
border:1px groove gray;
}
</style>
</head>
<body style="">
<div>
<div class="header">
Header
</div>
<div class="menu">
<div class="menuitem">Home</div>
<div class="menuitem">Home</div>
<div class="menuitem">Home</div>
<div class="menuitem">Home</div>
</div>
<!--should insert the serach bar here -->
<div class="search">Sökfunktioners utrymme. TODO: show/hide funktion
<br />
Sökfält1, etc
</div>
<!--<div class="logos">
<img src="images/hm-logo.png" class="logo"/>
<img src="images/mq-logo.jpg" class="logo" />
<img src="images/kapp-ahl-logo.svg" class="logo" />
<img src="images/dressmann-logo.png" class="logo" />
<img src="images/jack-jones-logo.jpg" class="logo" />
<img src="images/lindex-logo.svg" class="logo" />
<img src="images/brothers-logo.png" class="logo" />
</div>-->
<div class="productList">
<div class="product">
<img src="images/hm-logo.png" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/hmprod.jpg" width="200" />
<img src="ex/hmprod.jpg" width="200" />
<img src="ex/hmprod.jpg" width="200" />
</div>
<div class="product">
<img src="images/mq-logo.jpg" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/jack-jones-logo.jpg" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/kapp-ahl-logo.svg" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/dressmann-logo.png" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/jack-jones-logo.jpg" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/lindex-logo.svg" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/brothers-logo.png" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/brothers-logo.png" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<div class="product">
<img src="images/brothers-logo.png" class="logo" />
<div style="margin-bottom: 100px;"></div>
<img src="ex/fossil-planbok.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
<img src="ex/clock.jpg" width="200" />
</div>
<!-- <div style="clear:both;"></div>-->
</div><div style="clear:both;"></div></div>
</body>
</html>

CSS trouble with my header in IE

I am working on the following site: http://tcsdesignreno.com/nvvolunteers/.
It looks great in Firefox and Chrome but when I go to the home page in Internet explorer it drops the navigation menu down along with the social media icons on the left side (see the image below). Can anyone help me with finding the error in my css code so it will look correct across all browsers.
I am testing in IE 10 but have the same problems in later version.
I think the problem is coming from the top-margin in the social media area css but I can't figure out how to position it right above the nav bar without using this code.
POSSIBLE HTML CODE
<div class="social-media-home">
<a title="Follow us on Facebook" href="https://www.facebook.com/NevadaVolunteers" target="_blank">
<img class="alignleft size-medium wp-image-924" title="Follow us on Facebook" alt="Facebook" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/facebook.png" width="32" height="32" />
</a>
<a title="Check us out on Twitter" href="https://twitter.com/nvvolunteers" target="_blank">
<img class="alignleft size-medium wp-image-922" title="Follow us on Twitter" alt="Twitter" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/twitter.png" width="32" height="32" />
</a>
<a title="Pin us on Pinterest" href="http://pinterest.com/nvvolunteers/" target="_blank">
<img class="alignleft size-full wp-image-921" title="Pin us on Pinterest" alt="Pinterest" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/pinterest.png" width="32" height="32" />
</a>
<a title="See us on Instagram" href="http://instagram.com/nvvolunteers#" target="_blank">
<img class="alignleft size-medium wp-image-923" title="See us on Instagram" alt="Instagram" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/06/instagram_64x64.png" width="32" height="32" />
</a>
<a href="#" target="_blank">
<img class="alignleft size-full wp-image-926" style="display: none;" title="Add us on Google +" alt="Google Plus" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/GooglePlus.png" width="32" height="32" />
</a>
<a href="#" target="_blank">
<img class="alignleft size-medium wp-image-925" style="display: none;" title="Find us on Linked In" alt="LinkedIn" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/linkedin.png" width="32" height="32" />
</a>
<a href="#" target="_blank">
<img class="alignleft size-medium wp-image-923" style="display: none;" title="Watch us on YouTube" alt="YouTube" src="http://tcsdesignreno.com/nvvolunteers/wp-content/uploads/2013/05/youtube.png" width="32" height="32" />
</a>
</div>
<div id="home-nav-container">
<div class="resizer"><span id="font-resizer-ticker"></span></div>
<div id="home-nav"><?php wp_nav_menu( array('menu' => '5' )); ?></div>
</div>
POSSIBLE CSS CODE
.social-media-home {
position:relative;
float: right;
margin: 4.2rem 0.5rem 0 0;
clear:right;
}
.social-media-home img {
margin: 1rem 5px 0 0!important;
}
#home-nav-container {
float: right;
text-align: right;
clear: right;
}
#home-nav {
float: right;
padding: 0.8rem 1.0714rem 0 0;
}
#home-nav li{
display: inline-block;
font-weight:bold;
}
#home-nav li a{
text-decoration:none;
}
#home-nav li:not(:last-child):after
{
content: ' |';
}
.resizer {
/*clear:right;*/
float:right;
padding: 0.8rem 1.0714rem 0 0;
}
SCREEN SHOT
float left on .main-navigation and
float left on the title link inside the header hgroup -> I'd recommend putting this inside a div
Below is the site working in IE

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;
}

Resources