728x90
반응형

수직수평정렬 하기 어려울때 보면 도움이 될 만한 코드

 

특히 처음보는

  <h1 style="position:absolute; top:100px; text-align:center;">🧺세탁물 상태페이지🧺</h1>

앱솔루트 부분은 신기했다.

 

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
  href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
  rel="stylesheet"
  integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
  crossorigin="anonymous"
/>
<title>🧺세탁 신청서🧺</title>
</head>
<style>
*{margin:0; padding:0;}
html,body{width:100%; height:100%;}
body{background-image:url("https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdByfl%2FbtrVf7i5Uq5%2FjJ5afu7vrUKkgNGmzP2kAk%2Fimg.jpg"); background-repeat:no-repeat; background-size:cover;}
.flex_center{display:flex; align-items:center; justify-content:center; width:100%; height:100%;}
.status{border-radius: 50%; background-color: #6D67E4; width: 400px; height: 400px;}
</style>
<body>
<div class="flex_center">
  <h1 style="position:absolute; top:100px; text-align:center;">🧺세탁물 상태현황🧺</h1>
  <div class="status flex_center" style="color:#F2F7A1; font-size: 30px; font-weight:bold;">상태표시</div>
</div>
</body>
</html>

 

 

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
  href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
  rel="stylesheet"
  integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
  crossorigin="anonymous"
/>
<title>🧺세탁물 상태페이지🧺</title>
</head>
<style>
*{margin:0; padding:0;}
html,body{width:100%; height:100%;}
.form-control{height:40px; width:300px;}
body{background-image:url("https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdByfl%2FbtrVf7i5Uq5%2FjJ5afu7vrUKkgNGmzP2kAk%2Fimg.jpg"); background-repeat:no-repeat; background-size:cover;}
#preview{display:block; width:200px; height:200px; border-raidus:10px; margin-top: 30px;}
.flex_center{display:flex; align-items:center; justify-content:center; width:100%; height:100%;}
nav{display:block; float:left;}
.image-table{padding-left:50px;}
#button-req{padding-top:10px;}
</style>
<body>
<div class="flex_center">
  <h1 style="position:absolute; top:100px; text-align:center;">🧺세탁물 상태페이지🧺</h1>
  <form action="" method="">
    <nav class="input-table">
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">닉네임</label>
        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="닉네임" aria-describedby="emailHelp">
      </div>
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">전화번호</label>
        <input type="email" class="form-control" id="exampleInputEmail2" placeholder="전화번호" aria-describedby="emailHelp">
      </div>
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">주소</label>
        <input type="email" class="form-control" id="exampleInputEmail3" placeholder="주소" aria-describedby="emailHelp">
      </div>
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">요청사항</label>
        <input type="email" class="form-control" id="exampleInputEmail4" placeholder="요청사항" aria-describedby="emailHelp">
      </div>
    </nav>

    <nav class="image-table">
      <img id="preview" src="https://web.ipca.pt/sap/wp-content/codevision/resources/images/no-image.jpg">
      <input type="file" id="inputFile" onchange="readURL(this);" style="display:none;">
      <label for="inputFile" class="btn btn-secondary" style="width:200px; margin-top: 20px;">사진선택</label>
      <div id="button-req">
        <button type="button" class="btn btn-dark" style="width:200px;">신청하기</button>
      </div>
    </nav>
  </form>
</div>
</body>
<script type="text/javascript">
const input = document.querySelector('#myFileInput');
const preview = document.querySelector('#myImage');

input.addEventListener('change', updateImageDisplay);

function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();
    reader.onload = function(e) {
      document.getElementById('preview').src = e.target.result;
    };
  reader.readAsDataURL(input.files[0]);
  } else {
    document.getElementById('preview').src = "https://web.ipca.pt/sap/wp-content/codevision/resources/images/no-image.jpg";
  }
}
</script>
</html>
728x90
반응형

'기초코드' 카테고리의 다른 글

부트스트랩에서 화면비율 맞추기  (0) 2022.12.08
HTML, CSS 글자수 1줄, 2줄이상일때 처리방법  (0) 2022.12.02
Git Bash 작동코드  (0) 2022.10.27
OG태그  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
728x90
반응형
<div class="container-fluid" >
    <div class="row">
        <div class ="col-md-1"></div>
        <div class ="col-md-10" id="board_new"></div>
        <div class ="col-md-1"></div>
    </div>
</div>
728x90
반응형

'기초코드' 카테고리의 다른 글

HTML 기초코드(참고용)  (0) 2023.01.03
HTML, CSS 글자수 1줄, 2줄이상일때 처리방법  (0) 2022.12.02
Git Bash 작동코드  (0) 2022.10.27
OG태그  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
728x90
반응형

한줄일때

p {
   width: 6rem;
   text-overflow: ellipsis;
   overflow: hidden;
   white-space: nowrap;
}
  • width 값을 지정해야 한다!
  • overflow: hidden;, white-space: nowrap; 으로 설정한다.

두줄이상

p {
   width: 6rem;
   text-overflow: ellipsis;
   overflow: hidden;
   word-break: break-word;
    
   display: -webkit-box;
   -webkit-line-clamp: 2; // 원하는 라인수
   -webkit-box-orient: vertical
}
  • white-space:nowrap을 하면 두줄이상이 될 수 없으므로 word-break: break-word;으로 변경하고,
  • display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;를 추가한다.
728x90
반응형

'기초코드' 카테고리의 다른 글

HTML 기초코드(참고용)  (0) 2023.01.03
부트스트랩에서 화면비율 맞추기  (0) 2022.12.08
Git Bash 작동코드  (0) 2022.10.27
OG태그  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
728x90
반응형

ls

cd 폴더명

 

# python3 -> python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# pip3 -> pip
sudo apt-get update
sudo apt-get install -y python3-pip
sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

# port forwarding
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 5000

켜서 유지시키기
nohup python app.py &

강제종료
ps -ef | grep 'python app.py' | awk '{print $2}' | xargs kill

728x90
반응형

'기초코드' 카테고리의 다른 글

부트스트랩에서 화면비율 맞추기  (0) 2022.12.08
HTML, CSS 글자수 1줄, 2줄이상일때 처리방법  (0) 2022.12.02
OG태그  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
★기본 CSS노말라이즈★  (0) 2022.10.21
728x90
반응형

<meta property="og:title" content="내 사이트의 제목" />
<meta property="og:description" content="보고 있는 페이지의 내용 요약" />
<meta property="og:image" content="이미지URL" />

728x90
반응형

'기초코드' 카테고리의 다른 글

HTML, CSS 글자수 1줄, 2줄이상일때 처리방법  (0) 2022.12.02
Git Bash 작동코드  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
★기본 CSS노말라이즈★  (0) 2022.10.21
인라인 그리드, 이미지 박스  (0) 2022.10.21
728x90
반응형
<script>
    function q1() {
                $('#names-q1').empty();
        $.ajax({
            type: "GET",
            url: "http://spartacodingclub.shop/sparta_api/seoulair",
            data: {},
            success: function (response) {
                let rows = response['RealtimeCityAir']['row'];

                for (let i = 0 ; i < rows.length; i++){
                    let gu_name = rows[i]['MSRSTE_NM'];
                    let gu_mise = rows[i]['IDEX_MVL'];

                    let temp_html = ``

                    if ( gu_mise > 30){
                        temp_html = `<li class="bad">${gu_name} : ${gu_mise}</li>`
                    }
                        else{
                            temp_html = `<li>${gu_name} : ${gu_mise}</li>`
                    }

                    $('#names-q1').append(temp_html);
                }

            }
        })
    }
</script>
<script>
    function q1() {
            $('#names-q1').empty()
        $.ajax({
            type: "GET",
            url: "http://spartacodingclub.shop/sparta_api/seoulbike",
            data: {},
            success: function (response){
                let rows = response['getStationList']['row'];
                for (let i = 0; i < rows.length; i++){
                    let name = rows[i]['stationName']
                    let rack = rows[i]['rackTotCnt']
                    let bike = rows[i]['parkingBikeTotCnt']

                    let temp_html = ``

                    if ( bike < 5 ) {
                        temp_html = `<tr class="urgent">
                                        <td>${name}</td>
                                        <td>${rack}</td>
                                        <td>${bike}</td>
                                    </tr>`
                        } else {
                        temp_html = `<tr class>
                                        <td>${name}</td>
                                        <td>${rack}</td>
                                        <td>${bike}</td>
                                    </tr>`
                    }

                    $('#names-q1').append(temp_html)
                }

            }
        })
    }
</script>
<script>
    $.ajax({
        type: "GET",
        url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
        data: {},
        success: function (response) {
            let temp = response['temp']
            $('#temp').text(temp);
        }
    })
</script>
728x90
반응형

'기초코드' 카테고리의 다른 글

Git Bash 작동코드  (0) 2022.10.27
OG태그  (0) 2022.10.27
★기본 CSS노말라이즈★  (0) 2022.10.21
인라인 그리드, 이미지 박스  (0) 2022.10.21
메뉴박스 노말라이즈  (0) 2022.10.20
728x90
반응형

<노말라이즈 기본> - 습관화 할 것

 

* {
  margin:0;
}

html, body{
  height:100%;
  width:100%;
}

 

/* HMTL 부분 기본설정 */

<section class="section-1 con-min-width">

    <div class="con">

        <div class="img-box"></div>

    </div>

</section>

 

/* CSS 기본설정 */

/* 폰트 시작 */
@font-face {
  font-family: 'LotteMartDream';
  font-style: normal;
  font-weight: 400;
  src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamMedium.woff2') format('woff2'), url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamMedium.woff') format('woff');
}

@font-face {
  font-family: 'LotteMartDream';
  font-style: normal;
  font-weight: 700;
  src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamBold.woff2') format('woff2'), url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamBold.woff') format('woff');
}

@font-face {
  font-family: 'LotteMartDream';
  font-style: normal;
  font-weight: 300;
  src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamLight.woff2') format('woff2'), url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamLight.woff') format('woff');
}

html {
  font-family: 'LotteMartDream', sans-serif;
}
/* 폰트 끝 */

/* 노말라이즈 시작 */
body, ul, li {
  margin:0;
  padding:0;
  list-style:none;
}

a {
  color:inherit;
  text-decoration:none;
}
/* 노말라이즈 끝 */

/* 라이브러리 시작 */
.con {
  margin-left:auto;
  margin-right:auto;
}

.block {
  display:block;
}

.img-box > img {
  width:100%;
  display:block;
}

.bg-red {
  background-color:red;
}

.bg-blue {
  background-color:blue;
}

.inline-grid {
  font-size:0;
}

.inline-grid > * {
  font-size:1rem;
  display:inline-block;
  vertical-align:top;
}

.width-10p {
  width:10%;
}
/* 라이브러리 끝 */

/* 커스텀 시작 */
:root {
  --site-width:1200px;
}

.con-min-width {
  min-width:var(--site-width);
  padding:0 10px;
}

.con {
  width:var(--site-width);
}

/* 이미지 리스트 박스 시작 */
/* 이미지 리스트 박스 끝 */

/* 커스텀 끝 */

728x90
반응형

'기초코드' 카테고리의 다른 글

OG태그  (0) 2022.10.27
Ajax 기본골격  (0) 2022.10.21
인라인 그리드, 이미지 박스  (0) 2022.10.21
메뉴박스 노말라이즈  (0) 2022.10.20
주석표  (0) 2022.10.19
728x90
반응형

/* 도형별로 여백이 살짝 있으니, 여백 없애는 방법 */
.inline-grid {
   font-size : 0 ;
}

.inline-grid > * {
   display : inlin-block;
   font-size : 1rem;
   vertical-align : top;
}


/* 인라인은 애매한 여백이 있음, 블럭으로 애매한 여백을 없앰 */
.img-box > img {
    width : 100%;
    display : block; 
}

 

 

728x90
반응형

'기초코드' 카테고리의 다른 글

Ajax 기본골격  (0) 2022.10.21
★기본 CSS노말라이즈★  (0) 2022.10.21
메뉴박스 노말라이즈  (0) 2022.10.20
주석표  (0) 2022.10.19
부트스트랩 시작템플릿(JQuery 포함)  (0) 2022.10.19

+ Recent posts