동적 HTML 객체 모델 요소의 위치와 면적 계산
Understanding Properties That Measure Element Dimension and Location

diagram of a sample page showing the DHTML Object Model properties that are related to the dimension and location of elements
diagram of a sample page showing the DHTML Object Model properties that are related to the dimension and location of elements
diagram of a sample page showing the DHTML Object Model properties that are related to the dimension and location of elements

예제 테스트 링크
http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/overview/measure.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Measure for Measure</TITLE>
<SCRIPT type="text/javascript">
<!--
var lastfunc = 1;
function split() {
    switch(lastfunc) {
        case 1: one(); break;
        case 2: two(); break;
        case 3: three(); break;
        case 4: four(); break;
        default: five(); break;
    }
}
function iebody() {
    // Sense the difference between Strict and Quirks mode
    return (document.compatMode != "BackCompat"? document.documentElement : document.body);
}
function one() {
lastfunc = 1;
report.value = "The style object contains information that was set in the inline style to position the object. The following values are reported for the various position and dimension properties on the style object for the DIV above:" + "\n\n";
report.value += " mydiv.style.top (string) = " + mydiv.style.top + "\n";
report.value += " mydiv.style.left (string) = " + mydiv.style.left + "\n";
report.value += " mydiv.style.height (string) = " + mydiv.style.height + "\n";
report.value += " mydiv.style.width (string) = " + mydiv.style.width + "\n";
report.value += " mydiv.style.pixelTop = " + mydiv.style.pixelTop + "\n";
report.value += " mydiv.style.pixelLeft = " + mydiv.style.pixelLeft + "\n";
report.value += " mydiv.style.pixelHeight = " + mydiv.style.pixelHeight + "\n";
report.value += " mydiv.style.pixelWidth = " + mydiv.style.pixelWidth + "\n";
report.value += " mydiv.style.posTop = " + mydiv.style.posTop + "\n";
report.value += " mydiv.style.posLeft = " + mydiv.style.posLeft + "\n";
report.value += " mydiv.style.posHeight = " + mydiv.style.posHeight + "\n";
report.value += " mydiv.style.posWidth = " + mydiv.style.posWidth + "\n";
// Cancel the generic click event for the body
window.event.cancelBubble = true;
}
function two() {
lastfunc = 2;
report.value = "Offset properties for the DIV above: \n";
report.value += " mydiv.offsetLeft = " + mydiv.offsetLeft + "\n";
report.value += " mydiv.offsetTop = " + mydiv.offsetTop + "\n";
report.value += " mydiv.offsetHeight = " + mydiv.offsetHeight + "\n";
report.value += " mydiv.offsetWidth = " + mydiv.offsetWidth + "\n";
report.value += "Offset properties for the BODY: \n";
report.value += " offsetLeft = " + iebody().offsetLeft + "\n";
report.value += " offsetTop = " + iebody().offsetTop + "\n";
report.value += " offsetHeight = " + iebody().offsetHeight + "\n";
report.value += " offsetWidth = " + iebody().offsetWidth + "\n";
// Cancel the generic click event for the body
window.event.cancelBubble = true;
}
function three() {
lastfunc = 3;
report.value = "Scroll values for the DIV above: \n";
report.value += " mydiv.scrollLeft = " + mydiv.scrollLeft + "\n";
report.value += " mydiv.scrollTop = " + mydiv.scrollTop + "\n";
report.value += " mydiv.scrollHeight = " + mydiv.scrollHeight + "\n";
report.value += " mydiv.scrollWidth = " + mydiv.scrollWidth + "\n";
report.value += "Scroll values for the BODY: \n";
report.value += " scrollLeft = " + iebody().scrollLeft + "\n";
report.value += " scrollTop = " + iebody().scrollTop + "\n";
report.value += " scrollHeight = " + iebody().scrollHeight + "\n";
report.value += " scrollWidth = " + iebody().scrollWidth + "\n";
// Cancel the generic click event for the body
window.event.cancelBubble = true;
}
function four() {
lastfunc = 4;
report.value = "";
report.value += " clientHeight for the BODY: " + iebody().clientHeight + "\n";
report.value += " clientWidth for the BODY:" + iebody().clientWidth + "\n";
report.value += " clientTop for the BODY:" + iebody().clientTop + "\n";
report.value += " clientLeft for the BODY:" + iebody().clientLeft + "\n";
report.value += " clientHeight for this TEXTAREA:" + report.clientHeight + "\n";
report.value += " clientWidth for this TEXTAREA: " + report.clientWidth + "\n";
report.value += " clientTop for this TEXTAREA:" + report.clientTop + "\n";
report.value += " clientLeft for this TEXTAREA:" + report.clientLeft + "\n";
// Cancel the generic click event for the body
window.event.cancelBubble = true;
}
function five() {
lastfunc = 5;
report.value = "The following x and y values are passed on the event object for this mouse click event: \n";
report.value += " window.event.x = " + window.event.x + "\n";
report.value += " window.event.y = " + window.event.y + "\n";
report.value += " window.event.offsetX = " + window.event.offsetX + "\n";
report.value += " window.event.offsetY = " + window.event.offsetY + "\n";
report.value += " window.event.screenX = " + window.event.screenX + "\n";
report.value += " window.event.screenY = " + window.event.screenY + "\n";
report.value += " window.event.clientX = " + window.event.clientX + "\n";
report.value += " window.event.clientY = " + window.event.clientY + "\n";
// Cancel the generic click event for the body
window.event.cancelBubble = true;
}
-->
</script>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META NAME="AUTHOR" CONTENT="InetSDK">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="ROBOTS" CONTENT="noindex">

<!-- SAMPLE_STYLE_START -->
<LINK REL="stylesheet" HREF="/workshop/samples/samples.css" TYPE="text/css">
<!-- SAMPLE_STYLE_END -->
<STYLE type="text/css">
BODY {
    margin:0;
    border:10px solid #99ccff;
    padding:10px;
    font-family:arial;
    font-size:70%;
    background-color:white;
    color:black;
}
BUTTON {
    margin:2px;
}
#mydiv {
    overflow:scroll;
    margin:20px auto;
    background-color:white;
    padding:20px;
    border:10px solid #99ccff;
    font-size:150%;
}
#report {
    margin-top:25px;
    border:1px solid #cccccc;
    font-family:arial;
    width:90%;
}
</STYLE>
</HEAD>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->

<BODY onload="two()" onscroll="three()" onresize='split()' onclick="five()">
<DIV class="body">
<CENTER>

<!-- This DIV uses an inline style to test the style object above. -->
<DIV id="mydiv" onclick="one()" onscroll="three()" style="top:5px; left:5px; height:8em; width:90%;">
DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool!
</DIV>

<button onclick=one()>Style Positions</button>
<button onclick=two()>Object Offset</button>
<button onclick=three()>Scroll Positions</button>
<button onclick=four()>Client Area</button>
<button onclick=five()>Event Object</button>

<TEXTAREA id="report" rows=12 style=""></TEXTAREA>

</CENTER>

<!-- START_PAGE_FOOTER -->
<BR><BR><BR>
<p class="viewsource">[Right-click and choose View Source from the shortcut menu.] </p>
<A class="copyright" HREF="http://www.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm">&copy; 2007 Microsoft Corporation. All rights reserved. Terms of use.</A>
<!-- END_PAGE_FOOTER -->
</DIV>
</BODY>
</HTML>

이올린에 북마크하기(0) 이올린에 추천하기(0)

※ 녹색은 네츠케이프, 혹은 익스플로러 전용으로만 사용되는 객체(속성,메소드)입니다

객체(Object)

속성(Property)

메소드(Method)

이벤트핸들러

(Event Handler)

Anchor

name

 

 

text

x

y

anchors array

length

 

 

Applet

 

applet's methods

 

applets array

length

 

 

Area

hash

 

onClick

host

onmouseOut

gostname

onmouseOver

href

 

pathname

 

port

 

protocol

 

search

 

target

 

Array

length

concat

 

join

pop

push

reverse

shift

slice

sort

unshjft

Button

form

blur

onClick

name

click

onmouseDown

type

focus

onmouseUp

value

 

 

Checkbox

checked

blur

onClick

defaultChecked

click

onmouseDown

form

focus

onmouseUp

name

 

 

type

 

 

value

 

 

Date

 

getDate

 

getDay

getFullYear

getHours

getMilliseconds

getMinutes

getMonth

getSeconds

getTime

getTimezoneOffset

getUTCDate

getUTCDay

getUTCFullYear

getUTCHours

getUTCMilliseconds

getUTCMinutes

getUTCMonth

getUTCSeconds

getYear

parse

setDate

setFullYear

setHours

setMilliseconds

setMinutes

setMonth

setSeconds

setTime

setUTCDate

setUTCHours

setUTCMilliseconds

setUTCMinutes

setUTCMonth

setUTCSeconds

setYear

goGMTString

toLocaleString

toString

toUTCString

UTC

valueOf

document

activeElement

clear

 

alinkColor

close

all

createElement

Anchor

createStylesheet

anchors

elementFromPoint

Applet

getSelection

applets

open

Area

write

bgColor

writeIn

body

 

charset

 

children

 

cookie

 

defaultCharset

 

domain

 

embed

 

embeds

 

expando

 

fgColor

 

Form

 

forms

 

Image

 

images

 

lastModified

 

Layer

 

layers

 

linkColor

 

Link

 

links

 

location

 

parentWindow

 

plugins

 

readyState

 

referrer

 

scripts

 

selection

 

styleSheets

 

title

 

URL

 

vlinkColor

 

FileUpload

form

blur

onBlur

name

focus

onFocus

type

select

onSelect

value

 

 

Form

action

reset

onReset

Button

submit

onSubmit

Checkbox

 

 

elements

 

 

encoding

 

 

FileUpload

 

 

Hidden

 

 

length

 

 

method

 

 

name

 

 

Password

 

 

Radio

 

 

Reset

 

 

Select

 

 

Submit

 

 

target

 

 

Text

 

 

Textarea

 

 

forms array

length

 

 

frames array

length

 

 

Hidden

form

 

 

name

type

value

History

current

back

 

length

foward

next

go

previous

 

history array

length

 

 

Image

border

 

onAbort

complete

onError

height

onLoad

hspace

 

lowsrc

 

name

 

src

 

vspace

 

width

 

x

 

y

 

images array

length

 

 

Layers

above

load

onBlur

background

moveAbove

onFocus

below

moveBelow

onmouseOut

bgColor

moveBy

onmouseOver

clip

moveTo

onmouseUp

document

moveToAbsolute

 

hidden

resizeBy

 

left

resizeTo

 

name

 

 

pageX

 

 

pageY

 

 

parentLayer

 

 

siblingAbove

 

 

siblingBelow

 

 

src

 

 

top

 

 

visibility

 

 

window

 

 

x

 

 

y

 

 

zindex

 

 

layers array

length

 

 

Link

hash

 

onClick

host

onmouseOut

hostname

onmouseOver

href

 

pathname

 

port

 

protocol

 

search

 

target

 

text

 

x

 

y

 

links array

length

 

 

location

hash

reload

 

host

replace

hostname

 

href

 

pathname

 

port

 

protocol

 

search

 

Math

E

abs

 

LN2

acos

LN10

asin

LOG2E

atan

LOG10E

atan2

PI

ceil

SQRT1_2

cos

SQRT2

exp

 

floor

 

log

 

max

 

min

 

pow

 

random

 

round

 

sin

 

sqrt

 

tan

MimeType

description

 

 

enabledPlugin

suffixes

type

mimeTypes array

length

 

 

navigator

appCodeName

javaEnabled

 

appMinorVersion

preference

appName

savePreferences

appVersion

taintEnabled

browserLanguage

 

cookieEnabled

 

cpuClass

 

languages

 

mimeTypes

 

platform

 

plugins

 

systemLanguage

 

userAgent

 

userLanguage

 

userProfile

 

Number

MAX_VALUE

toString

 

MIN_VALUE

valueOf

NaN

 

NEGATIVE_INFINITY

 

POSITIVE_INFINITY

 

Option

defaultSelected

 

 

index

selected

selectedIndex

text

value

options array

length

 

 

Password

defaultValue

blur

onBlur

form

focus

onChange

name

select

onFocus

type

 

onKeydown

value

 

onKeypress

 

 

onKeyup

 

 

onSelect

Plugin

description

refresh

 

filename

name

plugins array

length

 

 

Radio

checked

blur

onClick

defaultChecked

click

onmouseDown

form

focus

onmouseUp

name

 

 

type

 

 

value

 

 

radio array

length

 

 

Reset

form

blur

onClick

name

click

onmouseDown

type

focus

onmouseUp

value

 

 

screen

availHeight

 

 

availLeft

availTop

availWidth

BufferDepth

colorDepth

height

pixelDepth

updayeInterval

width

Select

form

blur

onChange

length

focus

name

 

options

 

selectedIndex

 

type

 

String

length

anchor

 

big

blink

bold

charAt

charCodeAt

concat

fixed

fontcolor

fontsize

formCharCode

indexOf

italics

lastIndexOf

link

match

replace

search

slice

small

split

strike

sub

substr

substring

sup

toLowerCase

toUpperCase

Submit

form

blur

onClick

name

click

onMouseDown

type

focus

onMouseUp

value

 

 

Text

defaultValue

blur

onBlur

form

click

onChange

name

focus

onFocus

type

select

onKeydown

value

 

onKeyup

 

 

onSelect

Textarea

defaultValue

blur

onBlur

form

click

onChange

name

focus

onFocus

type

select

onKeydown

value

 

onKeyup

 

 

onSelect

window

clientInformation

alert

onBlur

closed

back

onError

defaultStatus

blur

onFocus

dialogArguments

close

onLoad

dialogHeight

confirm

onResize

dialogLeft

find

onUnload

dialogLeft

focus

 

dialogTop

forward

 

dialogWidth

home

 

document

moveBy

 

event

moveTo

 

frames

navigate

 

history

open

 

innerHeight

print

 

innerWidth

prompt

 

length

resizeBy

 

location

resizeTo

 

locationbar

scroll

 

menubar

scrollBy

 

name

scrollTo

 

navigator

stop

 

offscreenBuffering

 

 

opener

 

 

outerHeight

 

 

outerWidth

 

 

pageXOffset

 

 

pageYOffset

 

 

parent

 

 

personalbar

 

 

screen

 

 

screenX

 

 

screenY

 

 

scrollbars

 

 

self

 

 

status

 

 

statusbar

 

 

toolbar

 

 

top

   

이올린에 북마크하기(0) 이올린에 추천하기(0)
HTML과 자바스크립트에서 스타일시트 속성

BACKROUND(배경)
속    성   명
속   성   값
내      용
css
jsss
background
background
background-color
background-images
background-repeat
background-attachment
background-position
웹문서의 배경을 정의하며 각각의 속성값을 "," 없이 두 개 이상 설정할수 있다.
background-attachment
backgroundAttachment
scroll
fixed
배경그림을 고정 또는 스크롤
background-color
backgroundColor
color_RGB
color_NAME
rgb(red,green,blue)
transparent
배경 색상 및 배경색의 투명성 설정
background-image
backgroundImage
url(url)
none
배경그림 설정
background-position
backgroundPosition

backgroundPositionX

backgroundPositionY
top left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right
x% y%
xpos ypos
배경그림의 위치를 설정하며
백분율을 표시할 때는 숫자와 %를 사용하고 절대위치는 숫자로 표시한다.
background-repeat
backgroundRepeat
repeat
repeat-x
repeat-y
no-repeat
배경그림이 화면보다 작을 경우 반복해서 보여줄지 여부를 설정

TEXT(글자)
속    성   명
속   성   값
내      용
css
jsss
color
color
color_RGB
color_NAME
rgb(red,green,blue)
글자 색을 설정
direction
direction
ltr
rtl
글자를 표시하는 방향설정
letter-spacing
letterSpacing
normal
lengthpx
글자 사이의 간격을 지정 하며 픽셀은
숫자 다음에 px로 표시
text-align
textAlign
left
right
center
justify
글자의 정렬을 설정
text-decoration
textDecoration
none
underline
overline
line-through
blink
글자의 꾸밈 및 형식 설정
text-indent
textIndent
lengthpx
%
좌측 여백을 백분율 또는 픽셀값으로 설정
text-transform
textTransform
none
capitalize
uppercase
lowercase
글자의 대.소문자 변환 여부를 설정
word-spacing
whiteSpace
none
lengthpx
단어 사이의 간격을 설정

FONT(글꼴)
속    성   명
속   성   값
내      용
css
jsss
font
font
font-style
font-variant
font-weight
font-size
line-height
font-family

caption
icon
menu
글꼴에 관련된 속성을 설정하며 line-height 값은
줄과 줄 사이의 간격을 백분율로 표시하고 각각의 요소 값은
콤마없이 두 개 이상 설정할 수 있다.
font-family
fontFamily
family-name
generic-family
글꼴이름을 설정 우선순위에 따라 두 개이상 콤마로
연결할수 있다.
font-size
fontSize
xx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger
lengthpx
%
글자 크기를 설정
font-style
fontStyle
normal
italic
글자의 형태를 설정
font-variant
fontVariant
normal
small-caps
글자의 크기를 설정
font-weight
fontWeight
normal
bold
bloder
lighter
100
200
.....
800
900
글자의 두께를 설정

BORDER(경계선)
속    성   명
속   성   값
내      용
css
jsss
border
border
border-width
border-style
border-color
경계선의 너비, 형식, 색을 설정
두 개이상 설정 가능
border-bottom
borderBottom
border-bottom-width
border-style
border-color
아래 경계선의 너비, 형식, 색을 설정
두 개이상 설정 가능
border-bottom-color
borderBottomColor
border-color
아래 경계선의 색을 설정
border-bottom-style
borderBottomStyle
none
hidden
dotted
dashed
solid
double
groove
ridge
inset
outset
아래 경계선의 형식을 설정
border-bottom-width
borderBottomWidth
thin
medium
thick
lengthpx
아래 경계선의 두께를 설정
border-color
borderColor
color
콤마없이 두 개이상의 값을 설정가능
border-left
borderLeft
border-left-width
border-style
border-color
왼쪽 경계선의 너비, 형식, 색을 지정
두 개이상의 값을 설정가능
border-left-color
borderLeftColor
border-color
왼쪽 경계선의 색을 설정
border-left-style
borderLeftStyle
border-style
왼쪽 경계선의 형식을 설정
border-left-width
borderLeftWidth
width
왼쪽 경계선의 두께를 설정
border-right
borderRight
border-right-width
border-style
border-color
오른쪽 경계선의 너비, 형식, 색을 지정
두 개이상의 값을 설정가능
border-right-color
borderRightColor
border-color
오른쪽 경계선의 색을 설정
border-right-style
borderRightStyle
border-style
오른쪽 경계선의 형식을 설정
border-right-width
borderRightWidth
width
오른쪽 경계선의 두께를 설정
border-style
borderStyle
style
경계선의 형식을 설정
border-top
borderTop
border-top-width
border-style
border-color
위쪽 경계선의 너비, 형식, 색을 지정
두 개이상의 값을 설정가능
border-top-color
borderTopColor
border-color
위쪽 경계선의 색을 설정
border-top-style
borderTopStyle
border-style
위쪽 경계선의 형식을 설정
border-top-width
borderTopWidth
width
위쪽 경계선의 두께를 설정
border-width
borderWidth
width
경계선의 두께를 설정

MARGIN(여백)
속    성   명
속   성   값
내      용
css
jsss
margin
margin
margin-top
margin-right
margin-bottom
margin-left
여백의 속성을 설정
margin-bottom
marginBottom
auto
lengthpx
%
아래의 여백을 설정
margin-left
marginLeft
auto
lengthpx
%
왼쪽의 여백을 설정
margin-right
marginRight
auto
lengthpx
%
오른쪽의 여백을 설정
margin-top
marginTop
auto
lengthpx
%
위쪽의 여백을 설정

PADDING(경계선과 내용과의간격)
속    성   명
속   성   값
내      용
css
jsss
padding
padding
padding-top
padding-right
padding-bottom
padding-left
상,하,좌,우의 경계선과 글자 사이의 간격을 설정
padding-bottom
paddingBottom
lengthpx
%
아래 경계선과 글자 사이의 간격을 설정
padding-left
paddingLeft
lengthpx
%
왼쪽 경계선과 글자 사이의 간격을 설정
padding-right
paddingRight
lengthpx
%
오른쪽 경계선과 글자 사이의 간격을 설정
padding-top
paddingTop
lengthpx
%
위쪽 경계선과 글자 사이의 간격을 설정

LIST(목록)
속    성   명
속   성   값
내      용
css
jsss
list-style
list-style
list-style-type
list-style-position
list-style-image
목록의 형식,위치,그림의 속성을 설정
list-style-image
listStyleImage
none
url(url)
목록의 표시를 그림으로 설정
list-style-position
listStylePosition
inside
outside
목록 항목의 위치를 설정
list-style-type
listStyleType
none
disc
circle
square
decimal
decimal-leading-zero
lower-roman
lower-alpha
upper-roman
upper-alpha
lower-greek
lower-latin
upper-latin
hebrew
armenian
georgian
cjk-ideographic
hiragana
katakana
hiragana-iroha
katakana-iroha
목록의 항목 표시자의 속성을 설정

DIMENSION(영역)
속    성   명
속   성   값
내      용
css
jsss
height
height
auto
legthpx
%
영역의 높이를 설정
line-height
lineHeight
auto
legthpx
%
영역의 줄 간격을 설정
width
width
auto
legthpx
%
영역의 너비를 설정

CLASSIFICATION(식별)
속    성   명
속   성   값
내      용
css
jsss
cursor
cursor
url
auto
crosshair
default
pointer
move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help
커서의 모양을 설정
float
float
left
right
none
해당요소를 상위 요소안에서 좌.우로 이동할 것인가를 설정
position
position
static
relative
absolute
화면에 표시할 위치를 설정
visibility
visibility
visible
hidden
화면에 표시 여부를 설정

POSITION(위치)
속    성   명
속   성   값
내      용
css
jsss
bottom
bottom
auto
legthpx
%
상위의 요소 아래 경계선에서 떨어진 간격을 설정
clip
clip
rect(top,right,bottom,left)
auto
 

이올린에 북마크하기(0) 이올린에 추천하기(0)