<marquee> 태그를 이용하면 글자나 이미지를 상하좌우 방향으로 자동으로 움직이게 할 수 있습니다.

속 성 설 명
direction 대상을 어느 방향으로 흐르게 할 것인지를 결정
  • left: 왼쪽에서 오른쪽으로. 기본값
  • right: 오른쪽에서 왼쪽으로
  • up: 아래쪽에서 위쪽으로
  • down: 위쪽에서 아래쪽으로
bgcolor 배경색
behavior 대상을 어떤 방법으로 움직이게 할 것인지를 결정
  • scroll: 한 번 움직인 후 끝에 다다르면 다시 반복함. 기본값
  • alternate: 왔다갔다하며 반복해서 움직임.
  • slide: 한 번 움직인 후 멈춤.
width 박스의 너비
height 박스의 높이
scrollamount 대상이 움직일 때 한 번에 얼마만큼의 거리로 움직일 것인가를 결정
수치를 입력하며 수치가 커질수록 거리가 커짐
scrolldelay 대상의 움직이는 속도를 설정.
수치를 입력하며 수치가 커질수록 속도가 느려짐
loop 반복횟수. 기본값 infinite

behavior 속성이 scroll 일 때 결과입니다.

<marquee direction="up" bgcolor="yellow" behavior="scroll"
     width="100" height="100" scrolldelay="5">
하보니 PHP
</marquee>

하보니 PHP

behavior 속성이 aliernate 일 때 결과입니다.

<marquee direction="up" bgcolor="yellow" behavior="alternate"
            width="100" height="100" scrolldelay="5">
하보니 PHP
</marquee>

하보니 PHP

다음은 이미지를 이용한 결과입니다.

<marquee direction="left" bgcolor="yellow" behavior="scroll"
              width="100" height="100" scrolldelay="5">
<img src='aran.jpg' width='100' height='100'>
<img src='honda.jpg' width='100' height='100'>
</marquee>



0 댓글