<pre></pre>、<iframe></iframe>、<marquee></marquee>

<pre></pre>

<pre>标签中能够预定义格式化的文本,在<pre>中的文本通常会保留空格和换行符,文本也会呈现等宽字体。

  • <pre>标签的常见应用就是用来表示计算机的源代码。
  • <pre>元素是块级元素
  • <pre>只能包含文本和行内元素,块级元素不能放在其中
  • 制表符tab在<pre>标签定义的块当中可以起到应有的作用,每个制表符占据8个字符的位置,但并不推荐使用tab,因为在不同的浏览器中,tab的表现形式各不相同。在用<pre>标签格式化的文档段中使用空格,可以确保文本正确的水平位置。
  <pre>
    hhhhhhhhhhhhhh    hhhhhhhhhhhhhh 
    hhhhhhhhhhhh ooooooo
  </pre>
<style>
  pre{
     
     
    border: 1px solid rgb(13, 135, 206);
  }
</style>

在这里插入图片描述

<iframe></iframe>

  • <iframe> 标签规定一个内联框架。
  • 一个内联框架被用来在当前 HTML 文档中嵌入另一个文档。
  • 可以把需要的文本放置在 和 之间,这样就可以应对不支持 的浏览器。
  • 使用 CSS 为 (包括滚动条)定义样式。
  <iframe src="https://www.baidu.com">
    <p>您的浏览器不支持  iframe 标签。</p>
  </iframe>

在这里插入图片描述

<marquee></marquee>

属性:

  • behavior 设定滚动的方式
    alternate:来回滚动
    scroll:重复滚动
    slide:不重复滚动

  • bgcolor设定活动字幕的背景颜色

  • direction:设定活动字幕的滚动方向
    down:活动字幕的滚动方向向下
    left:活动字幕的滚动方向向左
    right:活动字幕的滚动方向向右
    up:活动字幕的滚动方向向上

  • height:设定活动字幕的高度

  • width:设定活动字幕的宽度

  • loop:设置滚动的次数,loop=-1时一直滚动下去,默认为-1

  • scrollamount:设定活动字幕的滚动速度 单位px

  • scrolldelay:字幕两次滚动之间的延迟时间,单位为毫秒

  • css属性
    在这里插入图片描述

   <marquee>HELLO WORLD</marquee>

    <marquee behavior="alternate">来回滚动</marquee>
    <marquee behavior="scroll">重复滚动</marquee>
    <marquee behavior="slide">不重复滚动</marquee>
  
    <marquee behavior="alternate" bgcolor="red">来回滚动</marquee>
  
    <marquee behavior="alternate" loop="2">滚动</marquee>
  
    <marquee scrolldelay="20" direction="Left">Welcome!</marquee>
    <marquee scrolldelay="20" direction="right">Welcome!</marquee>
    <marquee scrolldelay="20" direction="up">Welcome!</marquee>
    <marquee scrolldelay="20" direction="down">Welcome!</marquee>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43812504/article/details/112939776