使文本比已有的更大 - javascript
抱歉,如果这很简单,但我无法做到正确。问题是我所拥有的使文本从一个点变小。我的意思是,如果有一些已经很大的文本,那么它会使该文本再次变小。我需要使文本比以前更大。包含文本的元素的样式是通过 CSS 设置的,因此仅编辑样式属性是行不通的。
提前致谢! ——坦纳
Sorry if this a simple, but I can't get it right. The problem is that what I have makes the text smaller from a point. What I mean is that if there is some aleady large text, Then it will make that text small again. I need to make text larger than it was before. The styles for the elements containing the text are set through CSS, so just editing the style property wouldn't work.
Thanks in advance! - Tanner
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你的文本元素有一些 id 那么它可以很容易地完成。例如:
实际上
document.getElementById('yourid').style.fontSize=yourvalue
这是一般代码。在您想要通过直接编写代码或调用函数来再次增加文本大小的地方使用它。if your text element have some id than it can be done easily. For example:
Actually
document.getElementById('yourid').style.fontSize=yourvalue
this is the general code. Use it where you want to increase the text size again by direct writing the code or by calling a function.