Technical (HTML, CSS, JS) Flashcards

1
Q

What is HTML?

A

Hyper Text Markup Language for creating web pages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is HTML tag?

A

Keyword surrounded by angle brackets, usually come in pairs; first tag in pair is opening tag, second is closing and have forward slash before the tag name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is JavaScript?

A

JS is a programming language that is used to add interactivity to web pages. It is a client-side language (executed on the user’s computer, not on server). Can be used to add animations, pop-ups, form validation, etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where and how can you add JS code to HTML page?

A

There is internal and external JS code. Internal is inserted into HTML file between

 tags usually in body section. External JS is a separate file with JS code that is later linked to HTML file with 
 tag with src attribute, it's usually done in head section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is JS function? How is it executed? Why do we need to execute it?

A

Function is a block of code which only runs when it’s called. JS function is executed (called) by event only (button click, call within script or another function). Need to execute it so actions in function will be performed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is difference between == and === in JS?

A

== compares values, === compares values and types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the specifics of web applications and how it affect your testing activities?

A

Content is always HTML, CSS, JS and it is dynamically loaded into browser so you don’t need to install or set up anything. Also in browser you have dev tools which you can use for some testing activities;
Browser, dev tools, networking, CSS, tags, almost always gray box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain the basic structure of an HTML document.

A

Firstly there is Head where you specify page title, external JS and CSS files, etc;
then there is Body where all the main code located in form of DOM tree (parent and child elements structure); inside Body we have all tags which needed to display page (e.g.: div, span, p, img, a, h1..6, etc)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe the difference between HTML elements and HTML tags

A

Element is a component of a web page, tells a web browser how to structure and interpret a part of the HTML document, consists of opening and closing tags, formatting instructions, semantic meaning and content, also element is exactly what displayed on a web page, e.g.: <p style..>This is element</p>
Tag is a building block of a web page, indicates to a web browser of how a web page should be displayed, usually exist in pairs of starting and ending tags, e.g.: <h1></h1>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the difference between inline elements and block-level elements

A

Inline elements don’t start new line (span); block-level elements start new line and takes the whole width of the page (div)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the attributes and usage of the <img></img> tag in HTML

A

<img src=’link’ alt=’text’ style=’’>
Usage - to add images to the web page. Attributes: src - link/path to the image location, alt - alternative text that will be shown if img won’t load, style - to add inline CSS properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to create table in HTML?

A

<table>
<tr>
<td>text1</td>
<td>text2</td>
</tr>
<tr></tr>
</table>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain difference between relative and absolute URLs in HTML

A

Absolute URL is path to the element from the top most directory; relative - from current

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you add submit button to HTML page?

A

Button tag with input type submit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is input validation in HTML forms?

A

Checking if the form field accepts correct amount (min/max), type, format, etc of the user input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is CSS?

A

Cascading Style Sheet. It is for styling HTML documents. CSS is a design language that describes how to present a document written in a markup language such as HTML or XML.
CSS is used to style and lay out webpages, and can be used to adjust content size, spacing, color, and font. CSS can also add decorative features such as animations or splitting content into columns

17
Q

What are different ways to include CSS in HTML doc?

A

Inline, internal and external

18
Q

Explain the concept of CSS selectors specificity

A

It is the way CSS selectors prioritized if any conflicts occurs. Inline styling has the highest priority, then id, then class or pseudo-class, then tag

19
Q

What are the CSS pseudo-classes, and provide examples of their usage

A

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).
Pseudo-classes are used to add styles to selectors when those selectors meet certain conditions. For example, the pseudo-class :hover can be used to select a button when a user’s pointer hovers over the button. This selected button can then be styled.

20
Q

Describe CSS box model

A

Content, padding, border, margin - inside of each other

21
Q

What are differences between margin and padding in CSS?

A

Padding - between content and border; margin - outside border

22
Q

How do you center an element horizontally and vertically in CSS?

A

For text we use text-align:center, for most of other it’s easier to use margin or padding properties

23
Q

Describe the difference between relative, absolute, and fixed positioning in CSS.

A

Relative positioning is element positioned depending on something (page size or position of another element), absolute is element’s position is stated with absolute units, fixed is element’s position is stated and it won’t change at any circumstances

24
Q

What is the purpose of the z-index property in CSS?

A

To make elements be on top or under each other. The higher z-index property, the higher element will be

25
Q

How can you hide an element using CSS?

A

Visibility - hidden or display - none

26
Q

What are the different data types in JavaScript?

A

Types that can contain values: string, number, boolean, object, function.
Types of objects: Object, Date, Array, String, Number, Boolean.
Types that can’t contain values: null, undefined

27
Q

Explain the difference between let, var, and const in JavaScript

A

VAR are globally scoped (when declared outside of the function => if it’s declared globally it can be used in the whole window) or function(locally) scoped (when declared in the function => can be accessed only within that function), never block-scoped; it can be re-declared and updated (change the value assigned to the variable and create a new variable with the same name); it is hoisted to the top of their scope and initialized with the value of undefined (if we declare variable after statement that use it, it won’t show an error). E.g.:
(1)var greeter = “say hi”; // globally scoped, can be accessed from anywhere
function newFunction(){
var hello = “hello”;//locally scoped, can’t be accessed outside of the
//function
}
if(true){
var greeter = “hi”;//block scoped, doesn’t affect var, still can be
//accessed from anywhere
}
(2)var greeter = “hey”;
var greeter = “hello”;//this won’t show error, is a JS problem; re-declaration
greeter = “hi”;//also not an error; updating
(3)console.log(greeter);
var greeter = “say hey”;//won’t show error because it’s equal to:
var greeter;
console.log(greeter);//greeter undefined
greeter = “say hey”;
LET is block scoped so if it’s declared within a block it can’t be accessed outside of this block; can be updated but not re-declared (can change value, but can’t create variable with the same name), but if the same variable is defined in different scopes, there will be no error; is also hoisted to the top, but not initialized. E.g.:
(1)let greeting = “say hi”;//globally scoped
if(true){
let hello = “hi”;//block scoped, can’t be accessed outside of the block
}

(2)let greeting = “hello”;
greeting = “hi”;//updating is ok
let greeting = “say hi”;//re-declaration will return an error
(3)console.log(greeter);
var greeter = "hi"; //with var result will be undefined
console.log(hello);
 let hello = "hello"; //with let we have Reference Error CONST is for constant values; block scoped; can’t be updated or re-declared; hoisted to the top, but not initialized (like let)
28
Q

How do you create and call a function in JavaScript?

A

function functionName(parameters){code}//create a function
functionName//call a function

29
Q

How do you loop through an array in JavaScript?

A

for(i=0;i<=array.length-1;i++){
console.log(array[i]);}//output of all array values

30
Q

What is DOM?

A

Document Object Model. Way to represent the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.

31
Q

Explain the concept of parent and child nodes in the DOM

A

Child elements are nested in the parent elements and inherit their properties