統一的字體大小我想開有一個叫div
在Div1
舊頁面內容相同的新的一頁新的一頁。 在我的JavaScript函數中,有一個newWindow
變量,它由window.open
命令返回,我將Div1
的內部HTML寫入newWindow
,我希望新頁面中的每個單獨文本的字體大小爲7px。下面是我寫的:文件撰寫與整個
newWindow.document.write('<html><head><title>Hello World</title>');
newWindow.document.write('</head><body style="font-size:7px">');
newWindow.document.write($('Div1').html());
newWindow.document.write('</body></html>');
新的頁面呈現,但由於在Div1
內容被splited到3個fieldset
S,只有legend
小號那些fieldset
S的有他們的字體大小改爲7px的,該字段集內的一切仍然有默認的字體大小(大約11px)。如何將新頁面中的每個文本更改爲7px?我可以document.write
鏈接到新頁面的新樣式表,但我更喜歡內聯樣式。謝謝。
舊頁面(ASP.net):
<div id="Div1" runat=server>
<fieldset>
<legend class="LLegends"> Header </legend>
<asp:FormView ID="FormView1" runat="server">
contents that I want to be 7px in the new page
</asp:FormView>
</fieldset>
<!-- other 2 fieldsets with the same set up -->
</div>
類LLegends
(只類,它具有CSS樣式元素)
.LLegends {font-size: large;}
您必須向我們展示此處涉及的實際HTML。如果某些HTML標籤都有自己的'字體size'內嵌樣式設置或從一個樣式表CSS較高優先級繼承樣式,那麼你就''
標籤樣式不會覆蓋這些。 – jfriend00