본문 바로가기

UIUX Web Standard/COA Lab's CSS

문단과 관련된 속성

※ 문단과 관련된 속성

문단의 내용을 정리할 때 사용하는 속성으로, 문단 뿐만 아니라, 블록 요소에 적용할 수 있는 속성들이다. 

 


 

속성 설명
text-align left | right | center | justify 좌|우|가운데|양끝 정렬을 의미
적용된 태그의 안에 있는 요소들을 정렬하는 것이다.

예: p태그같은 블록요소 안의 텍스트,이미지 등의 요소가 정렬됨.
vertical-align top | middle | bottom 이미지나 폼요소에 주로 사용하며,
이미지의 세로 정렬이 아닌, 이미지 주변의 요소들과 이미지와의 세로배치를 정렬하는 것이다. 
text-indent 양수 | 음수px 들여쓰기다 되며, 기본은 왼쪽에 여백이 생기고, 음수를 적용하면 왼쪽으로 여백이 줄어든다.
word-wrap noraml | break-all | keep-all 기본값 | 넘치면 줄바꿈 | 단어를 끊어서 줄바꿈 하지 않음
white-space normal |
nowrap |
pre |
pre-wrap |
pre-line



길면 줄바꿈 |
길어도 줄바꿈 없이 박스 밖으로 나감 |
연속공백들과 줄바꿈이 소스 그대로 표현됨 |
연속 공백들과 줄바꿈이 소스대로 표현되지만, 길면 줄바꿈 |
연속공백이 모두 하나의 공백으로 처리, 줄바꿈은 표현되나, 길면 줄바꿈 일어남

- 문자 사이의 공백을 처리하는 속성
text-overflow ellipse 긴 텍스트에 말줄임 기호를 표현함

 

 


 

<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>문단</title>
  <style>
	p{
		background: #fde;
		width:700px; 
		height: 500px;
		text-align:justify;/*블록(문단)안의 요소를 정렬*/
		text-indent:5px;/*들여쓰기*/
		overflow:hidden;/*블록을 넘치는 요소에 대한 가시속성을 정함*/
	}
	img{
		width:100px;
		vertical-align:middle;
		/*img, input, select, label*/
		/*img태그 주변에 오는 요소에 대한 베이스라인 정렬*/
	}
  </style>
 </head>
 <body>
  <p>What is Lorem Ipsum?
	<img src="img/juice.jpg" alt="">
	What is Lorem Ipsum?
	What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).


Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
  </p>
 </body>
</html>

 

 

 

'UIUX Web Standard > COA Lab's CSS' 카테고리의 다른 글

background 속성 1 - 기본  (0) 2021.01.25
display 속성 2, 가시속성  (0) 2021.01.25
display 속성  (0) 2021.01.22
CSS 기초개념 : selector(선택자), 문자관련속성  (0) 2021.01.21
웹접근성을 위한 :focus  (0) 2020.08.25