css position: fixed;
position: fixed;가 있는 요소 는 뷰포트를 기준으로 배치됩니다.
즉, 페이지가 스크롤 되어도 항상 같은 위치에 유지됩니다.
위쪽, 오른쪽, 아래쪽 및 왼쪽 속성은 요소의 위치를 지정하는 데 사용됩니다.
고정 요소는 일반적으로 위치한 페이지에 간격을 두지 않습니다.
페이지의 오른쪽 아래에 고정 된 요소가 있음을 확인하십시오.
다음은 사용 된 CSS입니다.
예
div.fixed {
position: fixed;
bottom: 0;
right: 0;
width: 300px;
border: 3px solid #73AD21;
}
<!DOCTYPE html>
<html>
<head>
<style>
div.fixed {
position: fixed;
bottom: 0;
right: 0;
width: 300px;
border: 3px solid #73AD21;
}
</style>
</head>
<body>
<h2>position: fixed;</h2>
<p>An element with position: fixed; is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled:</p>
<div class="fixed">
This div element has position: fixed;
</div>
</body>
</html>

게시글 목록
| 번호 | 제목 |
|---|---|
| 3015 |
HTML
SVG Star
|
| 3014 | |
| 3013 |
HTML
SVG Rectangle
|
| 3012 |
HTML
SVG Circle
|
| 3011 | |
| 3010 | |
| 3008 | |
| 3007 | |
| 3006 | |
| 3005 | |
| 3004 | |
| 3003 |
HTML
HTML5 Canvas
|
| 3002 |
HTML
HTML5 <footer> 요소
|
| 3001 |
HTML
HTML5 <header> 요소
|
| 3000 |
HTML
html5 태그 정의
|
| 2999 | |
| 2998 |
HTML
HTML5 <aside> 요소
|
| 2997 |
HTML
HTML5 <nav> 요소
|
| 2996 | |
| 2995 | |
| 2994 | |
| 2993 | |
| 2992 | |
| 2991 | |
| 2989 | |
| 2988 | |
| 2987 | |
| 2986 | |
| 2985 | |
| 2984 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기