JS修改字体大小
如何用js去修改span中的字体大小<divid="neirong"><pstyle="line-height:30pt;text-indent:32pt;"><span...
如何用js去修改span中的字体大小
<div id="neirong">
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
</div> 展开
<div id="neirong">
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
</div> 展开
1个回答
展开全部
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language=javascript>
window.onload=function(){
var ps=document.getElementById('neirong').getElementsByTagName('span');
for(var i=0;i<ps.length;i++){
ps[i].style.fontSize="12px";
}
}
</script>
</HEAD>
<BODY>
<div id="neirong">
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
</div>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language=javascript>
window.onload=function(){
var ps=document.getElementById('neirong').getElementsByTagName('span');
for(var i=0;i<ps.length;i++){
ps[i].style.fontSize="12px";
}
}
</script>
</HEAD>
<BODY>
<div id="neirong">
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
<p style="line-height: 30pt; text-indent: 32pt;">
<span style="font-size:16px;">
谢谢!
</span>
</P>
</div>
</BODY>
</HTML>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询