HTML换行符和水平线

时间:2022-05-02 22:28:48

  • 换行符<br>

在一个标签内某处添加换行符,相当于在该处进行换行;

举例:

添加换行符前,

		<h2>About Us</h2>
		<p>Mr Green's Smelly Fish Emporium prides itself on catching, preparing and delivering
		the smelliest fish right to your doorstep. Whether you like to cook them, feed them to
		your cat, or just hide them in your unruly neighbours porch, Mr Green has it covered!</p>

HTML换行符和水平线

添加换行符后,

		<h2>About Us</h2>
		<p>Mr Green's Smelly Fish Emporium prides itself on catching, preparing and delivering
		the smelliest fish right to your doorstep. <br> Whether you like to cook them, feed them to
		your cat, or just hide them in your unruly neighbours porch, Mr Green has it covered!</p>

HTML换行符和水平线

  • 水平线<hr>

水平线是分割网页内容的一种方法;

举例:

添加水平线前,

		<p>We sell the smelliest fish on the planet</p>
		
		<ul>
			<li><a href="contact.html">Contact Us</a></li>
			<li><a href="prices/freshwater-fish-prices.html">Price List</a></li>
			<li><a href="http://www.163.com" target="_blank">Link to Netease Web</a></li>
			<li><a href="downloads/all-prices.pdf">Download C++ book</a></li>
		</ul>
		
		<h2>Types of Fish We Sell</h2>

HTML换行符和水平线

添加水平线后,

		<p>We sell the smelliest fish on the planet</p>
		
		<hr>
		
		<ul>
			<li><a href="contact.html">Contact Us</a></li>
			<li><a href="prices/freshwater-fish-prices.html">Price List</a></li>
			<li><a href="http://www.163.com" target="_blank">Link to Netease Web</a></li>
			<li><a href="downloads/all-prices.pdf">Download C++ book</a></li>
		</ul>
		
		<hr>
		
		<h2>Types of Fish We Sell</h2>

HTML换行符和水平线