HTML中<pr>标签使用错误导致段落无法分离的问题排查
问题分析与解决
- 排版问题根源:使用了非标准HTML标签
<pr>,这不是浏览器认可的块级段落标签,浏览器会将其视为行内元素,导致内容无法和上一段落分离,始终紧贴。 - 错误提示翻译:在此上下文中,不允许将pr元素作为body元素的子元素
解决方案
把所有 <pr> 标签替换为标准的段落标签 <p>,<p> 是HTML中定义段落的官方块级元素,浏览器会自动为其添加默认的上下外边距,实现段落间的分隔。
修正后的代码:
<p><strong>Weekly quizzes:</strong>are short online quizzes completed at the beginning of your tutorial. See the Scghedule above for the topics and dates of these quizzes. In general they cover the material from the previous lectures and are closed book. </p> <p><strong>Lab Excercises:</strong>in the tutorial your tutor will review the completion of your completed lab excercises. You are encouraged to attempt to complete the set excercises before your tutorial so you have time to discuss any issues that arise with your tutor and have time to get them marked off.</p> <p><strong>Assignments: Parts 1, 2 and 3:</strong> are incremental instalments of a web site development task. In Part 1 you will demonstrate your ability to develop and deploy on a server well-structured, linked Web pages with text, graphics, tables and forms, styled with CSS. Part 2 further extends the use of HTML elements and makes use of JavaScript to validate forms and add dynamic behaviour to the Web page. In Part 3 you will use forms to submit and retrieve data from a server using PHP and MySQL. </p>
内容的提问来源于stack exchange,提问作者Mandy
相关产品推荐
相关产品推荐

