나는이 솔루션을iOS에서 ePub (일반 HTML)의 글꼴을 올바르게 변경하는 방법은 무엇입니까? 제대로 작동하지 않습니다 그러나
How can I change font color and font style of ePub Book in iOS?
을 따르십시오. HTML
<body>
<div id="HolubiPosta-E-2.html" xml:lang="cs-CZ">
<div class="Z-kladn--grafick--r-me-ek">
<p class="Nazev para-style-override-3" id="toc_marker-2">Holubí pošta</p>
<p class="Z-kladn--odstavec para-style-override-4"><span>Už od rána slunce sypalo hlava nehlava zlato.</span></p>
는 두 번째 단락에 폰트를 변경하지만 첫째 단락에서 폰트를 변경하지 않는 부분이, 예를 들어.
모든 html 문서에서 font-family를 올바르게 변경하는 방법은 무엇입니까?
편집 : 나는
NSString *addCSSRule = @"function addCSSRule(selector, newRule) {"
"if (mySheet.addRule) {"
"mySheet.addRule(selector, newRule);" // For Internet Explorer
"} else {"
"ruleIndex = mySheet.cssRules.length;"
"mySheet.insertRule(selector + '{' + newRule + ';}', ruleIndex);" // For Firefox, Chrome, etc.
"}"
"}";
을 사용하고이 CSS를 내가 호출 방법 기능이 있습니다 추가된다
NSString *setTextFont = [NSString stringWithFormat:@"addCSSRule('html, body, div, p, span, a', 'font-family: %@;')", m_str_font_name];
[webView stringByEvaluatingJavaScriptFromString:setTextFont];
CSS : 여기
p.Nazev {
font-family : "Liberation Serif", serif;
font-weight : normal;
font-style : normal;
font-size : 1.33em;
text-decoration : none;
font-variant : normal;
line-height : 1.2;
text-align : center;
color : #0000ff;
text-indent : 0px;
margin : 0px;}
p.para-style-override-3 {
margin-bottom : 28px;
margin-top : 28px;}
p.para-style-override-4 {
text-align : justify;}
div.Z-kladn--grafick--r-me-ek {}
추가하려는 CSS 규칙을 공유 할 수 있습니까? –
언급 한 스레드에 있지만 여기에 복사했습니다. –
나는 CSS 규칙을 추가했다. 나는 당신이 무엇을 의미하는지 오해해서 미안합니다. –