...icon-vote {
background-color: #e6e6e6;
display: inline-block;
width: 26px;
height: 26px;
text-align: center;
margin-right: -1px;
position: relative;
cursor: pointer;
}
.icon-vote :last-child {
margin-right: 0;
}
.icon-vote i {
background-image: url(includes/images/sprite.png);
background-repeat: no-repeat;
display: inline-block;
position: absolute;
top: 6px;
left: 9px;
}
.icon-vote.icon-check i {
width: 10px;
height: 14px;
background-position: -216px 2px;
}
And in my Layout.Main file i have
<link rel="stylesheet" href="#event.getModuleRoot()#includes/styles/styles.css" type="text/css" />
The call in my view is as follows
<cfloop array="#rc.campCards#" index="Campaigns">
<li>
<div data-candidate-id="1" class="btn-group-voter inline">
<div class="icon-vote icon-check"><i></i></div>
</div>
<div class="align"><a href="#"><cfoutput>#Campaigns.getCampName()#</cfoutput></a> (R)</div>
</li>
</cfloop>
The CSS is seen on all pages so i know the style sheet is being used. However, only sprites like this have issues. When i place the code in a style tag on the view itself it works perfect... but i don't what all that style code just sitting in my view if possible. Any suggestions?
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-includes
--styles
---styles.css
--images
---sprites.pngbackground-image: url("../images/sprites.png");<i class="icon-vote icon-check"></i>As I said in the question, the style sheet is actually loading only the sprites are not.
Richard, I'm going to try that URL style of "../includes
Once I get my system up from home this morning ill see how it works out.
The sprites URL does work and the sprites load if I have all that code just slapped in a <style> tag on the view itself, but that's a sloppy approach.
I've tried every other URL style listed here but was hesitant. I was told to not mess with the CSS unless in emergency situations. Coming from micro controller programming a few months ago to a crash course on web application development, I took this a little too literal.
Use google dev tools (right click inspect element) and click the console tab. Anything not loading properly would show in red. If you’re getting 404s then just adjust the url in the css…
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
'../includes/includes/images/sprite.png'
'../images/sprite.png'
>> In John's example he is using an image by the definition of your links, otherwise there would be offsets for the image as defined by your links, Matt.
From his CSS:
.icon-vote i {
background-image: url(includes/images/sprite.png);
}
.icon-vote.icon-check i {
background-position: -216px 2px;
}
Looks like he’s using a sprite to me (when the class icon-check is added, he offsets the image to reveal a different icon).
That’s the perfect example of a CSS sprite.
Tom.
From: col...@googlegroups.com [mailto:col...@googlegroups.com] On Behalf Of Andrew Scott
Sent: 28 April 2013 08:43
To: col...@googlegroups.com