How to add a Google icon font to pseudo :before
Tags: css
Problem :
I'm using Google's material design icon fonts.
However I want to overlay one fone on top of another. The idea is to add a :before or :after element and style it something like this:
.material-icons:before
{
position:absolute;
content:"";
color:@accent-color;
font-size:2.4rem;
}
However, I'm not sure how to incorporate this: 
; into the content attribute - I'm tried a number of ways as well as using a converter on CSS tricks (which doesn't seem to work).
Any help appreciated.
Solution :
In CSS, to specify a character you would otherwise specify in HTML with the &
escape, for example; ✏
, you must use the \
escape, for example, content: "\9999"
.
.material-icons:before {
position: absolute;
content: "\E84E";
color: #882288;
font-size: 2.4rem;
}
To end an escaped character explicitly, use another \
, for example content: "\E84E\ Hello World";
CSS Howto..
They do synchronize. Try hacking http://threejs.org/examples/css3d_sandbox.html. You should be able to create a CSS3DObject and a PlaneGeometry that line up perfectly, assuming the same camera is used to render both....
<script> $(document).ready(function(){ $(window).bind('scroll', function() { var navHeight = $( window ).height() - 70; if ($(window).scrollTop() > navHeight) { $('nav').addClass('fixed'); } else { $('nav').removeClass('fixed'); } }); }); </script> .fixed {...
Are you just trying to add a dashed border to each item? If so, try adding the following in your CSS. .rcbItem {border-bottom:1px dashed #000;} Replace #000 with the hex...
On a limp here, but: $('#main h2').addClass('highlight'); Will add the highlight class to <h2> elements within (descendants of) the element with ID main, effectively making the <h2> element(s) match the...
I agree that the calculation of the width of the grid is not perfect in case of usage of autowidth: true. Nevertheless the problem which you describe is not a...
You could change the name which would ensure that regardless of users browsers, they would get the new file. In all places you reference the CSS file, reference a variable...
You can know if the select is focused select:focus {} Most times this indicates it is open, but not always. To know it 100% sure, you need javascript. I hope...
You have to use CSS animations with animation-iteration-count:infinite. Something like: @keyframes glow{ 100% { outline: none; padding: 3px 0 3px 3px; margin: 5px 1px 3px 0; box-shadow: 0 0 5px...
I can not test it, but this would be worth a try. I assume that <input type="image" /> is beeing treaded like an <img> by your browser. To prevent this,...
It's possible without JavaScript, see: http://jsfiddle.net/Khmhk/ This works in IE7+ and all modern browsers. HTML: <label for="test">Label</label> <span><input name="test" id="test" type="text" /></span> CSS: label { float: left } span {...
You can easily do it with ng-class directive: <form name="myForm"> <div class="control-group" ng-class="{ error: myForm.salt.$invalid }"> <label class="control-label" for="salt">Salt: </label> <div class="controls"> <input type="text" name="salt" ng-model="salt" ng-pattern="hexPattern">...
I think this should work.. Try It.. <div class="w3-container w3-light-green"> <div class="w3-container w3-sand w3-center" style="width:80%;margin:auto;"> test </div> </div> ...
You can structure your css like this: a { color: #0f0; } a.special { text-decoration: none; color: #00f; } a:hover { color: #0ff; } a.special:hover { text-decoration: underline; color: #ff0;...
Finally jsfiddle is up. I forked your fiddle and updated the HTML, CSS and added some jQuery. There are several ways to implement what you're trying to do here. Once...
You need 4 pseudo elements to create this properly, because triangles are created using borders, so they can't have a border and different background-color. We therefore need an inner and...
You can do this by using pure CSS alone like below: HTML: <img class='image' src='path_to_your_image.format' /> CSS: .image { -webkit-transition:-webkit-filter 0.4s ease-in-out; } .image { -webkit-filter: drop-shadow(5px 5px 5px #0f0);...
Here's a full example of how to make the line spacing within <td>s one and a half times the height of the font: <html><head> <style> td { line-height: 150%; }...
<body> <div id = "pageName"> REQUEST </div> <div id = "toAddress"> <table> <tr><td>To:</td><td id="toName">Company</td></tr> <tr><td>Fax:</td><td id="toFax">Uknown</td></tr>...
Try this JSfiddle This code only uses css and rotates trough the backgrounds you add. body{ -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-repeat: no-repeat; background-position: fixed; animation-duration: 5s;...
Thanks to @Asad for digging up some handy code, I was able to come up with a nice solution here's the jQuery version: $(function() { var isTransitionSupported = (function (pseudo,...
I solved this problem by simply adding a padding-top with value 15%
it doesn't :( i happen to stumble across this post while searching for the EXACT same problem. -ms-transform: rotate(-90deg) butchers the output into something unrecognizable. i think it's the right...
Try something like this using replace() $('div.text').html(function(i,v){ return v.replace(/(^|\s[A-Za-z]\s|$)/g,'<b>$&</b>'); }); DEMO...
Guys I found the solution myself. You should have a file called portal-ext.properties file in $TOMCAT_DIR/webapps/ROOT/WEB-INFO/classes Or more specifically for my win setup in C:\liferay\webapps\ROOT\WEB-INF\classes The file would hold the...
How about this: FIDDLE div { position:fixed; top: 50%; left:50%; background: url(http://placehold.it/50x50) no-repeat; width: 50px; height:50px; /*margin: offset here*/ } Here, the top left point of the image is at...
From the image you included in your question it looks like you have an image that fades out as it goes up which you are only repeating across the bottom...
Try the following code and here is FIDDLE div#Container { position: relative; } div#Declaration { //position: absolute;/***Removed**/ left: 40%; padding-top: 250px; } div#Skills { background-color: rgb(72, 141, 200); } h1...
Add the following 2 rules to your leftWrapper div: display:flex;justify-content: center; <div id="leftwrapper" style="width:590px;display:flex;justify-content: center; float:left; background-color:grey; overflow-y:auto; height:650px;"> FIDDLE...
You should use overflow:hidden.
This is the closest I could get : Demo. I think it's actually not bad. It combines a black shadow and a white one on top of it. .yourclass{ background-color:...