10월 06, 2022

오늘 날짜와 형광펜 효과 밑줄

오늘 날짜

|
블로그나 페이지에 위 처럼 오늘 날짜를 표시할 수 있다. 아래의 스크립트를 블로그나 해당 페이지에 삽입하면 되며, 빨간색 부분을 수정해서 영문과 한글 및 다른 언어로 표시할 수 있다.

<script language="Javascript">
<!--

var dayName = new Array ("일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일")

var monName = new Array ("1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월")

var now = new Date

document.write("오늘은 " + dayName[now.getDay()] + ", " + monName[now.getMonth()] + " "+now.getDate() +".")

//-->
</script> | <script>
atoj = new Date();
atoj1= atoj.getHours();
atoj2 = atoj.getMinutes();
atoj3= atoj.getSeconds();

if(atoj1==0){atoj4=" 오전";atoj1=12}
else if(atoj1 <= 11){atoj4=" 오전"} else if(atoj1 == 12){atoj4=" PM";atoj1=12} else if(atoj1 >= 13){atoj4=" 오후";atoj1-=12}

if(atoj2 <= 9){atoj2="0"+atoj2} document.write(""+atoj1+":"+atoj2+":"+atoj3+""+atoj4+""+"");
</script>

형광펜 효과 밑줄

페이지 문장에 형광펜 효과가 있는 밑줄을 나타낼 수 있다. 아래의 CSS를 해당 페이지에 스타일을 지정하고 삽입하면 된다. 굵기와 색채는 임의로 지정하면 된다.

.highlight{
  display: inline;
  box-shadow: inset 0 -10px 0 #c0f09c; 
}

오늘의 음력