본문 바로가기
개발일지/스파르타코딩클럽

웹개발 종합반 1주차 완료 및 개발일지

by NONY 2022. 3. 19.

단축키

  • 코드정렬
    • Windows: Ctrl + Alt + L
    • macOS: option + command + L
  • 들여쓰기
    • Tab
    • 들여쓰기 취소 : Shift + Tab
  • 주석
    • Windows: Ctrl + /
    • macOS: command + /

 

1. 가운데정렬

 텍스트 aline 및 margin : auto; 등을 사용

 margin 사용시 text등 움직이지 않는 경우 display : block;을 적용하여 블록으로 변경하면 이동가능

 

2. 부트스트랩 홈페이지 및  시작탬플릿

https://getbootstrap.com/docs/4.0/components/alerts/

 

Alerts

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

getbootstrap.com

<!doctype html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
        integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
        integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
        crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
        integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
        crossorigin="anonymous"></script>

    <title>스파르타코딩클럽 | 부트스트랩 연습하기</title>
</head>

<body>
    <h1>이걸로 시작해보죠!</h1>
</body>

</html>

 

3. 폰트 변경

구글폰트

https://fonts.google.com/?subset=korean 

 

Google Fonts

Making the web more beautiful, fast, and open through great typography

fonts.google.com

    •  link 태그를 복사해서 <head> ~ </head>사이에, CSS를 복사해서 <style> ~ </style> 사이에 넣습니다.
      /* CSS에 이 부분을 추가하면 완성! */
      * {
      	font-family: 'Nanum Gothic', sans-serif;
      }
      

 

 

4. 자바스크립트 적용

body내에 자바스크립트 적용해야할 부분에 명령어를 적어줌.

div, class, 등 있는부분에 onclick같은 자바스크립트 명령어를 입력

head 부분에 <script></script> 사이에 해당 명령어가 입력된(자바스크립트가 실행되어야 할)부분에 대한 함수를 입력

<script>
        function order(){
            alert('주문이 완료되었습니다!!')
        }
</script>

 

 

어려운데 재밌다..꾸준히 해보자