Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
i was wondering if there is any compiler is capable of parsing a css or scss file replacing all references to *.svg files with inline svg data. i found this:
body { background-image:
url("/assest/svg/test.svg");
}
would become
body { background-image:
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><linearGradient id='gradient'><stop offset='10%' stop-color='%23F00'/><stop offset='90%' stop-color='%23fcc'/> </linearGradient><rect fill='url(%23gradient)' x='0' y='0' width='100%' height='100%'/></svg>");
}
im looking for a way to make a portable css file without any dependencies. so far i found: https://github.com/jkphl/ but my tests so far did not show that data inlining may work. any ideas?
Compass allows you to inline the image with the inline-image helper...
background-image: inline-image("/assest/svg/test.svg");
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Here's what the HTML looks like:
<h4>Categories</h4>
<ul>
<li>Cars</li>
<li>Bikes</li>
<li>Planes</li>
</ul>
<h4>Brands</h4>
<ul>
<li>Audi</li>
<li>BMW</li>
<li>Mercedes</li>
</ul>
<h4>FAQ</h4>
<ul>
<li>FAQ1</li>
<li>FAQ2</li>
<li>FAQ3</li>
</ul>
I'm trying to extract only the brands using Scrapy. There are no distinguishing features between the category vs. brands section except that the H4 begins the new section. Also, there are many categories and brands so it's hard to hardcode it.
You can use the following or following-sibling axis.
For instance, in order to get the brands you can get to the desired h4 element by text and then get to the next ul sibling via following-sibling:
//h4[. = 'Brands']/following-sibling::ul[1]/li/text()
Demo from the Scrapy shell:
$ scrapy shell ./index.html
>>> response.xpath("//h4[. = 'Brands']/following-sibling::ul[1]/li/text()").extract()
['Audi', 'BMW', 'Mercedes']
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have my custom css (all Compass/SASS based) added to the site from the Master page, rather than include the CSS in the site settings. While in Design View, my custom css, has overridden the items from DesignMode.css.
My master page is loading in my compiled CSS this way:
<link href="/CMSPages/GetResource.ashx?stylesheetfile=/KFF/SalesForce/main.css" type="text/css" rel="stylesheet" />
What is the best method to isolate my CSS from the designview.css?
Might want to take a look at this article
I think you can also do something like this in your master page:
{% ViewMode == "LiveSite" ? "StyleSheet Link": "" %}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Given end users who don't want to inspect the code of D3js visualisations, nor copy-paste, etc.
Given a D3 <svg> element with all shapes and styles within itself (not within any external CSS).
Is there a library/code which allow this end user to click on a button to download the code as a standalone SVG file.
The file should be valid to be opened with Inkscape and other SVG compliant softwares. This allow and empower the end user to fork the file, open it into an SVG editor and make some more advanced designs on it.
Here's a nice way to use svg-crowbar.js to provide a button on your site to allow your users to download your visualization as svg.
0) You need JQuery.
1) Define your button's CSS:
.download {
background: #333;
color: #FFF;
font-weight: 900;
border: 2px solid #B10000;
padding: 4px;
margin:4px;
}
2) Define your button's HTML/JS:
<a
class="download"
href="javascript:(function () { var e = document.createElement('script'); if (window.location.protocol === 'https:') { e.setAttribute('src', 'https://rawgit.com/NYTimes/svg-crowbar/gh-pages/svg-crowbar.js'); } else { e.setAttribute('src', 'http://nytimes.github.com/svg-crowbar/svg-crowbar.js'); } e.setAttribute('class', 'svg-crowbar'); document.body.appendChild(e); })();">
<!--⤋--><big>⇩</big> Download
</a>
Here's a closer look at that javascript:
javascript:(function (){
var e = document.createElement('script');
if (window.location.protocol === 'https:') {
e.setAttribute('src', 'https://rawgit.com/NYTimes/svg-crowbar/gh-pages/svg-crowbar.js');
} else {
e.setAttribute('src', 'http://nytimes.github.com/svg-crowbar/svg-crowbar.js');
}
e.setAttribute('class', 'svg-crowbar');
document.body.appendChild(e);
})();
3) You're done. This produces an svg download that Inkscape can open.
Note: svg-crowbar.js is loaded from https://rawgit.com or http://nytimes.github.com; you may prefer to integrate it into your website/folder.
If you want to do everything on the client, then one option would be to use Javascript to create an HTML blob object using the SVG content, then encode that blob as a data uri associated with a button or <a> tag.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I have an image in my index.php page.On clicking the image I have to redirect the URL to another Domain using .htaccess redirection.
Try this
HTML CODE
<a href="http://yourdomain.com/img.jpg" target="_blank"><img src="foldername/img.jpg" alt="image" height="10px" width="25px">
</a>
.HTACCESS CODE
RewriteRule ^img.jpg$ http://example.com/ [R=301,L]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I have the following line in a JSP page:
<c:if test="${postAuditBean.postAudit.authority == authority.value}">
I would like change this comparison to first trim leading and trailing spaces from both the left and right hand expressions prior to comparison... as in something like this:
<c:if test="${trim(postAuditBean.postAudit.authority) == trim(authority.value)}">
I tried this:
<c:if test="${fn:trim(postAuditBean.postAudit.authority) == fn:trim(authority.value)}">
which generated a parsing error in the JSP page.
Can anyone tell me how to trim blanks from JSTL subexpressions?
Refer : JSTL fn:trim() Function