728x90
position: relative; | ์์น๋ฅผ ๊ณ์ฐํ ๋ static์ ์๋ ์์น๋ถํฐ ๊ณ์ฐํ๋ค. |
position: absolute; |
์๋ ์์น์ ์๊ด์์ด ์์น๋ฅผ ์ง์ ํ ์ ์๋ค. ๋จ, ๊ฐ์ฅ ๊ฐ๊น์ด ์์ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก ์์น๊ฐ ๊ฒฐ์ ๋๋ค. |
<div id="testImg">
<img src="/images/test.png" width="700" height="350" alt="ํ
์คํธ์ด๋ฏธ์ง" />
<button class="btn1" type="button" onclick="javascript:sensorBtnClick('btn1');">๋ฒํผ1</button>
<button class="btn2" type="button" onclick="javascript:sensorBtnClick('btn2');">๋ฒํผ2</button>
</div>
<style>
#testImg{
postiion : relative;
width: 700px;
height: 350px;
}
button.btn1 {
position: absolute;
top: 170px;
left : 35px;
}
button.btn2 {
position: absolute;
top: 85px;
left : 95px;
}
</style>
๊ฒฐ๊ณผ
'css' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] table ๋์ด ๊ณ ์ ์ํค๊ธฐ (0) | 2021.06.10 |
---|---|
[css] overflow ์ฌ์ฉํ๊ธฐ (์คํฌ๋กค) (5) | 2021.05.10 |
[css] ul li ๊ฐ๋ก ์ ๋ ฌ (0) | 2021.04.23 |
[css] ๋ฐ์ํ ์น calc() (0) | 2021.04.23 |
[css] ํ ์คํธ์ ๊ทธ๋ผ๋ฐ์ด์ ๋ฃ๊ธฐ (0) | 2021.01.13 |