Programming/css2016. 1. 11. 14:02



The id Selector

The id selector uses the id attribute of an HTML element to select a specific element.

The id of an element should be unique within a page, so the id selector is used to select one unique element!

To select an element with a specific id, write a hash (#) character, followed by the id of the element.

The style rule below will be applied to the HTML element with id="para1":


The class Selector

The class selector selects elements with a specific class attribute.

To select elements with a specific class, write a period (.) character, followed by the name of the class.

In the example below, all HTML elements with class="center" will be red and center-aligned:


[링크 : http://www.w3schools.com/css/css_syntax.asp]


id는 유일한 거라고 하지만.. 크롬이나 ie에서 실험적으로 해봐도

경고나 에러를 띄우진 않는데.. 머가 맞는걸려나..

[링크 : http://okky.kr/article/89313]

[링크 : http://www.homejjang.com/07/class_id.php

'Programming > css' 카테고리의 다른 글

css float overflow  (0) 2018.08.20
css 우선순위  (0) 2018.08.09
html css 적용 방법  (0) 2016.01.11
css margin / padding  (0) 2015.09.24
css body background  (0) 2015.09.22
Posted by 구차니
Programming/css2016. 1. 11. 10:32

크게는 세가지

1. html에 style을 이용해서 적용

<head>

<style>

...

</style>

<head> 


2. css를 끌어와서 적용

<head>

<link rel="stylesheet" type="text/css" href="./style.css">

</head> 


3. 어트리뷰트로 사용

<h1 style="color:blue;">This is a Blue Heading</h1> 



[링크 : http://www.w3schools.com/html/html_css.asp]

'Programming > css' 카테고리의 다른 글

css 우선순위  (0) 2018.08.09
css 문법 - id / class  (0) 2016.01.11
css margin / padding  (0) 2015.09.24
css body background  (0) 2015.09.22
CSS / JS 파일 용량 줄이기  (0) 2015.09.18
Posted by 구차니

적어 둔줄 알았는데 없네 -_-


[링크 : http://www.w3schools.com/html/html_responsive.asp]

'Programming > javascript & HTML' 카테고리의 다른 글

HTML form 은 중첩불가..  (0) 2016.01.14
HTML5용 슬라이더 바  (0) 2016.01.13
ul li 메뉴 .. 2?  (0) 2016.01.11
div 쪼금 이해 될락말락...  (0) 2016.01.08
setTimeout()와 setInterval()  (0) 2016.01.07
Posted by 구차니

포인트는.. li의 display : inline


끄면 이렇게 처참하게! 듀둥!


2015/09/16 - [Programming/Javascript / HTML] - ul / li로 메뉴 꾸미기


'Programming > javascript & HTML' 카테고리의 다른 글

HTML5용 슬라이더 바  (0) 2016.01.13
반응형 웹... w3cshool 링크  (0) 2016.01.11
div 쪼금 이해 될락말락...  (0) 2016.01.08
setTimeout()와 setInterval()  (0) 2016.01.07
html5 live video streaming...  (0) 2015.11.23
Posted by 구차니
개소리 왈왈/자전거2016. 1. 10. 21:36

와이어가 죄다 늘어났나...

기어도 칼 기어였는데 이상해졌고

브레이크야 머.. 원래 그랬는데

언제쯤 돈이 생겨서 울테로 갈 수 있으려나...




그나저나 오늘 잠시 탔다고

허벅에 안에 물집잡혔네 ㅠㅠ

Posted by 구차니

일단 청소는 끝인데..

체인은 빼고~


결국은 자전거를 못탔네 ㅋㅋ


남은건 피팅

체인 청소

그리고.. 속도계 배터리 교체?

Posted by 구차니

내가 원하는 레이아웃이 있는데

그걸 만들려고 지금까지 몇달 걸렸던가 ㄷㄷㄷ


얘는 쉬운데..

top;

menu; float

content; float

라면...

얘는 답이 안나온다.. -_-?!?!?


위와 같은 방법으로 하면

이런식으로 깨어지기만 하니까?


결론은.. div로 싸고 싸고 또 싸고 ㅋ

absolute를 하는 것도 방법이지만 고정 위치이고 여러가지 이유로 웬지 끌리지 않으니


menu ; float

container ; float

    top

    content

식으로 하면 깔끔하게 해결!



[링크 : http://yongja.tistory.com/48]

[링크 : http://mkyoon.com/56]

'Programming > javascript & HTML' 카테고리의 다른 글

반응형 웹... w3cshool 링크  (0) 2016.01.11
ul li 메뉴 .. 2?  (0) 2016.01.11
setTimeout()와 setInterval()  (0) 2016.01.07
html5 live video streaming...  (0) 2015.11.23
div span 블럭구조 및 원형테두리  (0) 2015.09.23
Posted by 구차니

"코스피 1,700선까지 갈수도" 최악 시나리오 나왔다

[링크 : http://media.daum.net/economic/finance/newsview?newsid=20160108081617062]



막상 확인해보니.. 1700이면 참..

최악 시나리오 치고 꿈이 소소하구나.. 싶네

Posted by 구차니

30~50만원 사용시 10% 할인이고

한번 할인 받으려면 5만원 이상 구매 해야 하는데

30~50만원 구간에서는 주간 만원(온라인) / 주말 만원(오프) 할인으로

역산해보면

10만원 결제 하면 만원 할인되고 주간이나 주말 하나 한번에 끝!


다시 생각해보면

주말에 10만원어치 한번

주중에 10만원어치 한번

이렇게 20쓰면 할인 금액을 다 쓰게 된다.

고로.. 최소 금액인 30을 채우기 위해서는 할인 받지 못하는 10만원을 또 써야 하고


체감(?) 할인율은

30에 2만원으로 6.67% 대 인가..




손해보고 장사할리는 없지만 먼가.. 커보이면서도 막상 계산해보니 크지 않은 기분이네...


2/30 = 0.067

3/50 = 0.06

4/70 = 0.057

5/90 = 0.056

엥? 왜 점점 쓰는게 커지면 할인율이 낮아져?


[링크 : http://www.lottemart.com/event/detail.do?categoryId=C0070872&SITELOC=JC004]

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

사진 인화 준비..  (0) 2016.02.11
소득공제 제공동의  (0) 2016.02.02
2015년 끝  (0) 2015.12.31
무료..  (0) 2015.12.26
... 멀 해야 하지?  (0) 2015.12.07
Posted by 구차니

서버에서 시간을 받아와서 웹 브라우저 상에서 

setTimeout()으로 구현된 예제를 보고 있노라니..

pc의 시간과 다르게 가서 고민..


생각해보니까

setTimeout은 1회성으로

내부 루틴에서 처리할거 처리하고 지정을 지정하면

조금씩 조금씩 시간이 밀려 날 걸로 예상이 된다.


그런 이유로 setInterval이 조금은 더 정확한 시간간격으로 수행이 가능하지 않을까? 라고 예상


[링크 : http://www.w3schools.com/js/js_timing.asp]



[링크 : http://honjoo.tistory.com/32]

[링크 : http://charlie0301.blogspot.com/2014/11/javascript-timer.html]


<body onload="setInterval(function(){ function1(); function2();}, 500);">

[링크 : http://stackoverflow.com/questions/6660755/can-a-body-tag-hold-multiply-onload-setinterval]



----

setInterval 버전

<body onload="setInterval(function(){realtimeClock();},1000);">


<script type="text/javascript">

var systime = 20;


function realtimeClock()

{

var cTime = new Date((systime++)*1000); // EN672 System Time

svrTime.innerHTML = getTimeStamp(cTime);

}


function getTimeStamp(d)

{

var s = leadingZeros(d.getFullYear(), 4) + '-' +

leadingZeros(d.getMonth() + 1, 2) + '-' +

leadingZeros(d.getDate(), 2) + ' ' +

leadingZeros(d.getHours(), 2) + ':' +

leadingZeros(d.getMinutes(), 2) + ':' +

leadingZeros(d.getSeconds(), 2);

return s;

}


function leadingZeros(n, digits)

{

var zero = '';

n = n.toString();

if (n.length < digits)

{

for (i = 0; i < digits - n.length; i++)

zero += '0';

}

return zero + n;

}

</script>


<div id="svrTime"></div>


</body> 


setTimeout 버전

<body onload="realtimeClock();">


<script type="text/javascript">

var systime = 20;


function realtimeClock()

{

var cTime = new Date((systime++)*1000); // EN672 System Time

svrTime.innerHTML = getTimeStamp(cTime);

setTimeout("realtimeClock()", 1000);

}


function getTimeStamp(d)

{

var s = leadingZeros(d.getFullYear(), 4) + '-' +

leadingZeros(d.getMonth() + 1, 2) + '-' +

leadingZeros(d.getDate(), 2) + ' ' +

leadingZeros(d.getHours(), 2) + ':' +

leadingZeros(d.getMinutes(), 2) + ':' +

leadingZeros(d.getSeconds(), 2);

return s;

}


function leadingZeros(n, digits)

{

var zero = '';

n = n.toString();

if (n.length < digits)

{

for (i = 0; i < digits - n.length; i++)

zero += '0';

}

return zero + n;

}

</script>


<div id="svrTime"></div>


</body> 


완전하진 않지만 대충.. refresh 해서

setInterval은 2초 늦고 setTimeout은 1초 정도 늦게 시작 했으나


setTimeout은 30분이 지난 시점에서 상당히 벗어나 있음

'Programming > javascript & HTML' 카테고리의 다른 글

ul li 메뉴 .. 2?  (0) 2016.01.11
div 쪼금 이해 될락말락...  (0) 2016.01.08
html5 live video streaming...  (0) 2015.11.23
div span 블럭구조 및 원형테두리  (0) 2015.09.23
ul / li로 메뉴 꾸미기  (0) 2015.09.16
Posted by 구차니