php表单标题怎么设置字体
关于网页字体的设置我们可以使用css样式来做,具体的属性是font-family。下面来看看怎么设置form表单的标题吧。
1、首先form里有一个h2标签,用来显示form的标题。
<form action="form_action.php" method="get"> <h2 class="form-title">改名</h2> <p>First name: <input type="text" name="fname" /></p> <p>Last name: <input type="text" name="lname" /></p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p> <input type="submit" value="Submit" /> </form>
2、然后我们在head里写上style标签,并加上样式。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> .form-title{ font-family:"Times New Roman",Georgia,Serif; } </style> </head> <body> <form action="form_action.php" method="get"> <h2>标题</h2> <p>First name: <input type="text" name="fname" /></p> <p>Last name: <input type="text" name="lname" /></p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p> <input type="submit" value="Submit" /> </form> </body> </html>
font-family可以设置使用哪种字体,字体名不需要引号,但字体名有空格就需要使用引号包裹。
注:h1-h6为通用标题,h1每个页面只能使用一次,多了不利于seo。
更多PHP相关知识,请访问PHP中文网!
以上就是php表单标题怎么设置字体的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号