在HTML元素上分配多种样式 [英] Assigning multiple styles on an HTML element
本文介绍了在HTML元素上分配多种样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚开始使用HTML,但在为文本分配多种样式时遇到麻烦. 我想创建一个具有两个属性的标题:
I'm just starting out with HTML and I'm having a trouble assigning multiple styles to a text. I'd like to create a title with two properties:
- 居中
- 字体:Tahoma
我尝试过这个:
<h2 style="text-align:center";"font-family:tahoma">TITLE</h2>
但是它不起作用...
but it doesn't work...
我在做什么错了?
推荐答案
在HTML中,样式标签具有以下语法:
In HTML the style tag has the following syntax:
style="property1:value1;property2:value2"
所以在您的情况下:
<h2 style="text-align:center;font-family:tahoma">TITLE</h2>
希望这会有所帮助.
这篇关于在HTML元素上分配多种样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文