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 구차니

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

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


얘는 쉬운데..

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 구차니

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

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 구차니
Programming/C Win32 MFC2015. 12. 21. 14:54

엥? 이런 넘도 있었나? -ㅁ-?



$ g++ float.c -lm

float.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]

float.c:3:11: error: ‘::main’ must return ‘int’

float.c: In function ‘int main()’:


$ gcc float.c -lm

float.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]

float.c: In function ‘main’:



If you are familiar with C++ and macros, then


#import "Class.h" 

is similar to


{

#pragma once


#include "class.h"

}

[링크 : http://stackoverflow.com/.../what-is-the-difference-between-import-and-include-in-objective-c] 

'Programming > C Win32 MFC' 카테고리의 다른 글

윈도우에서 dll 동적 라이브러리 사용하기  (0) 2016.04.04
가변 매크로 __VA_ARGS__  (0) 2016.03.18
"\n" 의 cpu 점유율?  (0) 2015.10.12
rand()와 RAND_MAX  (0) 2015.10.05
Cppcheck  (0) 2015.09.30
Posted by 구차니
Programming/web 관련2015. 12. 9. 14:51

서버 사이드 스크립트 언어 라고 규정되는데

<!--#directive parameter=value parameter=value -->

위와 같은 문법으로 사용되며 shtml 이라는 확장자로 사용된다(어?)


[링크 : https://en.wikipedia.org/wiki/Server_Side_Includes]


[링크 : https://www.linux.co.kr/unixwebhosting/ssi/index.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi01.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi02.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi03.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi04.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi05.htm]

'Programming > web 관련' 카테고리의 다른 글

NPAPI / PPAPI - VLC ...  (0) 2016.01.14
HTML5 video player 720p/1080p 재생여부  (0) 2016.01.13
홈페이지 검증  (0) 2015.09.17
웹 서버별 특징  (0) 2015.09.11
DASH - Dynamic Adaptive Streaming over HTTP  (0) 2015.09.11
Posted by 구차니
Programming/openCV2015. 11. 27. 15:25

혹시 imshow가 바로 그리지 않아서 일려나?

나중에 복사 이후 imshow에서

바로 updateWindow() 해주고

그거까지 묶어줘봐야 겠다


[링크 : http://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html#updatewindow]

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

opencv stitch  (0) 2016.07.14
opencv rtsp  (0) 2016.07.13
openMP + openCV 미스테리..  (0) 2015.11.09
휴 모멘트?  (0) 2015.10.20
opencv 카메라 왜곡 수정  (0) 2015.10.20
Posted by 구차니

canvas에 직접 그리는 느낌이긴한데..

차이점은 모르겠지만...


html5의 video 태그가 live video는 안되는데 반해

웹소켓을 통해서 전송해주고

office-ambient.mpg 파일로 해서 스트리밍을 하는 것 같긴한데 ... 흐음...


[링크 : http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets]

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

div 쪼금 이해 될락말락...  (0) 2016.01.08
setTimeout()와 setInterval()  (0) 2016.01.07
div span 블럭구조 및 원형테두리  (0) 2015.09.23
ul / li로 메뉴 꾸미기  (0) 2015.09.16
<link> 관련 약어 정리  (0) 2015.09.14
Posted by 구차니