티스토리 뷰
width, height
- width 속성: 선택한 요소의 넓이를 설정 고정값(px), 가변값(%)
- height 속성: 선택한 요소의 높이를 설정
font
- font-family: 브라우저마다 지원하는 폰트가 다름. 입력한 순서대로 우선순위 적용. sans-serif는 마지막에 작성하는 디폴트 값
- font-weight: 100~900 사이의 숫자를 입력할 수도 있음.
border
- border-style
실선: solid
점선: dotted - 주석과 같이 한 줄에 이어 쓸 수도 있음
- 이때, 쉼표는 작성하지 않고 띄어쓰기만 함
background
- background-repeat
x축으로 반복: repeat-x
y축으로 반복: repeat-y
반복하지 않음: no-repeat - background-position
공간 안에서 이미지의 좌표를 변경할 때
top, bottom, center, left, right 등
지시사항 1
- .paragraph의 넓이와 높이를 500px로 설정합니다.
- 배경색은 green으로 설정합니다.
- 폰트는 크기 50px, 굵게, 이탤릭체로 설정합니다. 글꼴은 Times, Arial, sans-serif로 설정합니다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS 주요 속성 1</title>
<style>
.paragraph {
width: 500px;
height: 500px;
background-color: green;
font-size:50px;
font-family:Times, Arial, sans-serif;
font-style: italic;
font-weight: bold;
}
</style>
</head>
<body>
<h1 class="paragraph">Nice to meet you</h1>
</body>
</html>
지시사항 2
- 테두리는 실선(solid) 형태로, 두께는 2px, 색상은 빨간색으로 설정합니다.
- 배경색은 노란색으로, 배경 이미지는 엘리스 로고 그림으로, 이미지 반복없이(no-repeat), 가운데(center) 정렬로 설정합니다.
- 이미지 파일명은 elice_logo.png 입니다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS 주요 속성 2</title>
<style>
.paragraph {
width: 500px;
height: 500px;
background-color: yellow;
font-size; 50px;
font-weight: bold;
font-style: italic;
font-family: Arial, times, sans-serif;
border: solid 2px red;
background-image: url(elice_logo.png);
background-repeat: no-repeat;
background-position: center;
}
</style>
</head>
<body>
<h1 class="paragraph">Nice to meet you</h1>
</body>
</html>
'JAVA' 카테고리의 다른 글
움직이는 웹사이트 제작(Transition, Animation) (0) | 2023.10.17 |
---|---|
웹사이트 레이아웃 (0) | 2023.10.08 |
캐스케이딩 (0) | 2023.10.07 |
CSS 속성의 상속 (0) | 2023.10.07 |
CSS 선택자 (0) | 2023.10.07 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- plot
- mysql
- 데이터분석
- 금리
- 파이썬
- python
- 코딩
- sql
- 코테
- SW
- 코드
- 스마트워치
- 경제
- 데이터
- 자바
- Programming
- 프로그래머스
- 함수
- 개발
- 영어회화
- 코딩테스트
- 보안
- 클래스
- 머신러닝
- 영어
- 경제신문
- R
- 모듈
- 프로그래밍
- 그래프
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함