right 속성은 요소의 수평 위치를 설정하는 데 사용됩니다. -
로 설정됩니다.right: auto|length|initial|inherit;
예시
CSS에서 올바른 속성을 구현하는 예를 살펴보겠습니다 −
<!DOCTYPE html> <html> <head> <style> div { text-align: justify; text-justify: inter-word; color: white; background-color: orange; position: absolute; right: 90px; } </style> </head> <body> <h2>Demo Heading</h2> <div>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div> </body> </html>
출력
예시
다른 예를 살펴보겠습니다 -
<!DOCTYPE html> <html> <head> <style> .demo { background-color:orange; width:100px; position:relative; right:0px; color: white; } </style> </head> <body> <h1>Details</h1> <div class="demo">Examination Center near ABC College.</p> <div class="demo2">Exam begins at 11AM.</p> </body> </html>
출력
예시
이제 음수 값의 예를 살펴보겠습니다. -
<!DOCTYPE html> <html> <head> <style> .demo { background-color:orange; width:100px; position:relative; right:-100px; color: white; } </style> </head> <body> <h1>Details</h1> <div class="demo">Examination Center near ABC College.</p> <div class="demo2">Exam begins at 11AM.</p> </body> </html>
출력