본문 바로가기
html, css, javascript

html, css로 터미널 처럼 표현하기

by 타닥타닥 토다토닥 부부 2024. 2. 25.
반응형

html, css로 터미널 처럼 표현하기

 

HTML CSS 코드

 

터미널의 에러 메세지를 html 로 표현에서 블로글로 올릴일이 뜨문뜨문 있어서요. 전 아래와 같이 html, css 코드를 작성하였습니다.

<head>
<style>
  .terminal {
    background-color: black; /* 배경색 검정 */
    color: white; /* 글자색 하양 */
    border: 2px solid green; /* 테두리 색상 및 두께 */
    padding: 20px; /* 내부 여백 */
    font-family: 'Courier New', Courier, monospace; /* 폰트 스타일 */
    font-size: 16px; /* 글자 크기 */
    white-space: pre-wrap; /* 공백과 줄바꿈 처리 */
  }
</style>
</head>
<div class="terminal">Error: 
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow This command may take a few minutes to run due to the large size of the repository. This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience!
</div>

 

적용 예시

 

위 코드를 적용한 예시는 아래와 같습니다.

 

Error: homebrew-cask is a shallow clone. To `brew update`, first run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow This command may take a few minutes to run due to the large size of the repository. This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience!

 

코드펜 예시

 

위 코드 내용을 코드펜에 작성해둔 예시 입니다.

See the Pen 터미널 화면처럼 by hyunho (@momalcy) on CodePen.

반응형

댓글