피드로 돌아가기
새로워지기·서른의 생활코딩

샘플소스2) javascript 기본 문서구조 ( 문제2_BY jquery 02 )

NS
normalstory
표지 이미지

js 2_5 예제2_BY jquery 02



예제 2를 요즘 잘나간다던 jquery로 구현한다면?  2


<!DOCTYPE html>


<html>


<head>


<meta charset="UTF-8"/>


<title>예제2_BY jquery 02</title>


<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>




<script type="text/javascript">


//<![CDATA[


str = "<ul>";


for (i=1; i<=25; i++) {


str += "<li>" + i + "</li>";


}


str += "</ul>";


document.write(str);




$('ul > li').css("float","left");


$('ul > li').css("list-style","none");


$('ul > li').css("width","60px");


$('ul > li').css("height","60px");


$('ul > li').css("background-color","#dcdcdc");


$('ul > li').css("margin","1px");


$('ul > li').css("text-align","right");


$('ul > li').css("padding","1em .5em 0 0");


$('ul > li').css("font-size","1.2em");


$('ul > li').css("font-weight","bolder");




$('ul > li:nth-child(5n+1)').css("clear", "left");




//]]]]>


</script>


</head>


<body>


</body>


</html>

친절한 찰쓰씨
글쓴이
친절한 찰쓰씨
친절한 찰쓰씨 · 일상 UX 디자이너
기획·디자인·단상을 조용히 기록합니다.
작가 페이지에서 더 보기

이어서 읽기

새로워지기

꾸준히, 오래, 지치지 않고

Mar 31, 2026·8
새로워지기

테크 라이프 발란스

Feb 7, 2026·3
새로워지기

휴탈리티 박정렬

Feb 7, 2026·11