在html中怎么设置一行字两个不同样式的字体

在html中怎么设置一行字两个不同样式的字体

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<body>标签中,输入html代码:

<span style="font-family: Arial">hello </span>
<span style="font-family: 宋体">world </span>

3、浏览器运行index.html页面,此时一行文字用了不同的样式的字体显示。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-26
<!DOCTYPE html>
<html>
 <head>
  <title> New Document </title>
<meta name="content-type" content="text/html; charset=UTF-8">
 </head>

 <body>
  <font color="red">第一行字</font><font  color="lightblue">第一行字</font>
 </body>
</html>

本回答被提问者和网友采纳
第2个回答  2017-11-08
HTML代码:
<div class=“color”>
<p>our product:<span>$12.9</span></p>
</div>
CSS代码:
.color p{里面添加你想要的字体和颜色样式}
.color span{里面添加你想要的字体和颜色样式}
相似回答