상세 컨텐츠

본문 제목

[TestDome] HTML/CSS and JavaScript Test Questions

PROGRAMMING/Web

by koharin 2021. 1. 10. 16:50

본문

728x90
반응형

Try a test를 하면 각 test 당 4개의 Question을 풀 수 있다.

각 문제마다 주어진 시간이 있고, 시간이 끝나면 자동으로 다음 문제로 넘어간다.

sample question 2개는 고정적이고, test 시 나오는 Question 4개는 랜덤하게 바뀐다. 따라서 기본으로 있는 easy 3문제 포함해서 다른 문제들로 구성되어 있다.

test를 풀면서 새롭게 풀어본 문제는 6문제이다.

 

 

Question 1 (JavaScript) ✅

 

 

function formatDate(userDate) {
  // format from M/D/YYYY to YYYYMMDD
  date=userDate.split('/');
  return date[2].concat(('0'+date[0]).slice(-2), ('0'+date[1]).slice(-2));
}

console.log(formatDate("12/31/2014"));

 

 

Question 2 (CSS) ✅

 

 

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Styling links</title>
    <style type="text/css">
      /* Write your CSS solution here (do not edit the surrounding HTML) */
      a:link{
      text-decoration: none;
      text-transform: uppercase;
      }
      a:hover{
        cursor:help;
      }
      a::after {
  content: "<";
}
a::before {
  content: ">";
}
    </style>
  </head>
  <body>
    <a href="http://www.testdome.com">Check documentation</a>
  </body>
</html>
  • a태그 content 속성으로 before와 after에 string을 추가할 수 있다.
  • a:hover 는 해당 link에 커서를 놓았을 때의 상태에 대한 속성으로, 커서를 놓았을 때 ? 표시를 cursor:help 속성을 줬다.
  • 디폴트로 text-decoration: none으로 underline을 제거하고, text-transform: uppercase로 모두 대문자로 표시되게 했다.

 

 

Question 3 (HTML) ✅

 

 

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Company page</title>
  </head>
  <body>
    <p>Welcome! Here you can find the following things:</p>
    <ol>
      <li><em><a href="#logo">Company's logo</a></em></li>
      <li><a href="#employees">List of employees</a></li>
    </ol>

    <h1>Company's logo</h1>
    <p>Company uses the following logos:</p>
    <ul>
      <li>New logo:<img src="https://www.testdome.com/content/images/logo/favicon_32x32.png">
      </li>
      <li>Old logo:<img src="https://www.testdome.com/content/images/icons/order-bullet.png">
      </li>
    </ul>

      <h1>List of employees</h1>
    <table>
    <thead>
      <tr>
      <th>First name</th>
      <th>Last name</th>
      </tr>
    </thead>
      <tr>
        <td>Mary</td>
        <td>Williams</td>
      </tr>
      <tr>
        <td>James</td>
        <td>Smith</td>
      </tr>
    </table>
  </body>
</html>
  • Paragraphs: <paragraph> -> <p> 
  • Headings: <h1>에서 닫는 태그가 없었음. </h1>를 추가해준다.

 

 

Question 4 (HTML) ✅

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Link</title>
  </head>
  <body>
    <!-- Write the code below this line -->
    <a href = "www.google.com">Google!</a>
  </body>
</html>

 

 

 

 

Question 5 (CSS) ✅

 

 

 

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Spreadsheet</title>
    <style>
      td {
        text-align: right;
        width: 33%;
      }
      td, th, table {
        border: 1px solid;
        border-collapse: collapse;
      }
      th {
        text-align: left;
      }
    </style>
  </head>
  <body>
    <table>
      <thead>
      <caption>Purchase Order</caption>
      <th>Order Date</th>
      <th>SKU</th>
      <th>Quantity</th>
      </thead>
      <tbody>
      <tr>
      <td>07-16-2018</td>
      <td>523402</td>
      <td>54</td>
    </tr>
      </tbody>
    </table>
  </body>
</html>
  • table 태그의 제목은 <caption> 태그이며, 그냥 사용하면 자동으로 center 처리됨

 

Question 6 (JavaScript) ✅

 

function average(a, b) {
  return (a + b) / 2;
}

console.log(average(2, 1));
728x90
반응형

관련글 더보기