HTML, CSS, Bootstrap, Javascript(기초)

은영·2021년 7월 4일
1

SPARTA_WEB_START

목록 보기
1/11

1-3) HTML, CSS 기본 내용

HTML과 CSS의 개념

HTML은 뼈대, CSS는 꾸미기
head는 페이지의 속성 정보, body는 페이지의 내용

HTML 기초 코드

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>스파르타코딩클럽 | HTML 기초</title>
</head>

<body>
    <!-- 구역을 나누는 태그들 -->
    <div>나는 구역을 나누죠</div>
    <p>나는 문단이에요</p>
    <ul>
        <li> bullet point!1 </li>
        <li> bullet point!2 </li>
    </ul>

    <!-- 구역 내 콘텐츠 태그들 -->
    <h1>h1은 제목을 나타내는 태그입니다. 페이지마다 하나씩 꼭 써주는 게 좋아요. 그래야 구글 검색이 잘 되거든요.</h1>
    <h2>h2는 소제목입니다.</h2>
    <h3>h3~h6도 각자의 역할이 있죠. 비중은 작지만..</h3>
    <hr>
    span 태그입니다: 특정 <span style="color:red">글자</span>를 꾸밀 때 써요
    <hr>
    a 태그입니다: <a href="http://naver.com/"> 하이퍼링크 </a>
    <hr>
    img 태그입니다: <img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" />
    <hr>
    input 태그입니다: <input type="text" />
    <hr>
    button 태그입니다: <button> 버튼입니다</button>
    <hr>
    textarea 태그입니다: <textarea>나는 무엇일까요?</textarea>
</body>

</html>

실행 화면

1-4) 간단한 로그인 페이지 제작

로그인HTML 코드

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>로그인페이지</title>
</head>
<body>
    <h1>로그인 페이지</h1>
    <p>ID: <input type="text"/></p>
    <p>PW: <input type="text"/></p>
    <button>로그인하기</button>
</body>
</html>

실행화면


1-5) CSS 기초

CSS 기초

  • 배경관련
    background-color, background-image, background-size

  • 사이즈
    width, height

  • 폰트
    font-size, font-weight, font-famliy, color

  • 간격
    margin, padding

1-6) 자주 쓰이는 CSS

CSS 학습

h1, h5, background-image, background-size, background-position
color, width, height, border-radius, margin, padding

margin은 바깥 여백을, padding은 내 안쪽 여백
width를 주고, margin: auto를 사용하자! 그래도 안되면? display:block을 추가!

소스 코드

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>스파르타코딩클럽 | 로그인페이지</title>
<style>
.mytitle {
color: white;
width: 300px;
height: 200px;
background-image: url('https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg');
[스파르타코딩클럽] 웹개발 종합반 - 1주차 23
background-position: center;
background-size: cover;
border-radius: 10px;
text-align: center;
padding-top: 40px;
}
.wrap {
margin: 10px auto;
width: 300px;
}
</style>
</head>
<body>
<div class="wrap">
<div class="mytitle">
<h1>로그인 페이지</h1>
<h5>아이디, 비밀번호를 입력해주세요</h5>
</div>
<div>
<p>
ID: <input type="text" />
</p>
<p>
PW: <input type="password" />
</p>
</div>
<button>로그인하기</button>
</div>
</body>
</body>
</html>

실행 화면

1-7) 폰트, 주석, 파일분리

(6) 부트스트랩, 예쁜 CSS 모음집

Bootstrap(부트스트랩)

Quiz함께 만든 페이지를 발전시켜보세요!
Quiz
나홀로메모장의 포스팅박스를 완성하기!

Javascript

Javascript 기초 문법

Javascript 연습

profile
Leyn(레인)

0개의 댓글