• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/34

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

34 Cards in this Set

  • Front
  • Back

How to fix a page when the columns are 75% and 25% and floated opposite sides but the side bar has still fallen?


  • Using box-sizing: border-box; on the appropriate elements is the most efficient fix.
  • Using calc() on the widths to remove the 1rem padding is another way.
  • Putting the padding on an added internal wrapper element instead of the columns is a fix that will work with very deep browser support.
  • Adjusting the numbers to make the math work is another way. For instance making the widths of the columns 4% narrower and using 2% for the padding instead.

responsive design

  • change pixel widths to percentages
  • For images - If the max-width property is set to 100%, the image will scale down if it has to, but never scale up to be larger than its original size
  • for background images - setting background size : contain
  • Use different images for different devices with media queries for instance for a screen size of 400px up you can use @media only screen and (min-width: 400px)
  • You can use the media query min-device-width, instead of min-width, which checks the device width, instead of the browser width. Then the image will not change when you resize the browser window
  • then there is the html 5 picture element which acts like the video element with an inner tag that has srcset attribute example
<picture>

<source srcset="img" media="(max-width: 400px)"
srcset="img_smallflower.jpg" media="(max-width:>



</picture>

images replacement

border: 0;


clip: rect(0 0 0 0)


height: 1px;


margin: -1px;


overflow: hidden


padding: 0


position:absolute


width: 1px

What is the box model

The CSS box model is fundamental to understanding layout and sizing and such.


It's made up of:



  • Width and height (or in the absence of that, default values and the content inside)
  • Padding
  • Border
Margin is not technically apart of the box model because it does not affect its size it affects interactions with the box


What does a reset css file do?

resets to a consisit baseline

How to clear floats

  • use a clear-fix
  • float parent as well
  • use an over-flow property other than visible on the parent

What is the difference between inline, inline-block and block

  • Block - A number of elements are set to block by the browser UA stylesheet. They are usually container elements, like ,div , section and ul . Also text "blocks" like and . Block level elements do not sit inline but break past them. By default (without setting a width) they take up as much horizontal space as they can.
  • Inline-Block - An element set to inline-block is very similar to inline in that it will set inline with the natural flow of text (on the "baseline"). The difference is that you are able to set a width and height which will be respected.
  • Inline - The default value for elements. Think of elements like span, em, or b and how wrapping text in those elements within a string of text doesn't break the flow of the text. An inline element will accept margin and padding, but the element still sits inline as you might expect. Margin and padding will only push other elements horizontally away, not vertically.


what is SVG?

it is an scalable vector graphic vecotr graphics dont loose image quality upon scaling

non standard fonts

use @font-face from google link it in

[role=navigation] > ul a:not([href^=mailto]) {}

selects all anchor links that are not email

css selectos

  • class
  • id

css pseudo selectors

the describe the state selectors are in



  • :link
  • :visted
  • :active
  • :hover
  • :focus
  • first-child
  • last-child
  • nth-child
  • nth-last-child
  • nth-of-type
  • first-of-type
  • last-of-type
  • empty

what does this selctor mean


A E

Any E element that is a descendant of an A element (that is: a child, or a child of a child, etc.)

A > E

Any E element that is a child (i.e. direct descendant) of an A element

E:first-child

Any E element that is the first child of its parent

B + E

Any E element that is the next sibling of a B element (that is: the next child of the same parent)

what does this code print


var a = b = 5;

5


because b is in the global scope unless 'user strict'

native method

you could create a string method by using


string.prototype.methodName

hoisting

hoisted variables dont retain value just declared hoisted functions work

this context

see other notes

What is === operator?

=== is called as strict equality operator which returns true when the two operands are having the same value without any type conversion.

Explain how can you submit a form using JavaScript?

To submit a form using JavaScript use document.form[0].submit();document.form[0].submit();

How can the style/class of an element be changed?


  1. document.getElementById(“myText”).style.fontSize = “20?;

document.getElementById(“myText”).className = “anyclass”;

How can you convert the string of any base to integer in JavaScript?

The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given string.

Explain the difference between “==” and “===”?

“==” checks only for equality in value whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different.

What would be the result of 3+2+”7″?

Since 3 and 2 are integers, they will be added numerically. And since 7 is a string, its concatenation will be done. So the result would be 57.

What do mean by NULL in Javascript?

The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.

What is an undefined value in JavaScript?

Undefined value means theVariable used in the code doesn’t existVariable is not assigned to any valueProperty doesn’t exist

What are all the types of Pop up boxes available in JavaScript?

AlertConfirm andPrompt

What is the difference between .call() and .apply()?

The function .call() and .apply() are very similar in their usage except a little difference. .call() is used when the number of the function’s arguments are known to the programmer, as they have to be mentioned as arguments in the call statement. On the other hand, .apply() is used when the number is not known. The function .apply() expects the argument to be an array.

Define event bubbling?

JavaScript allows DOM elements to be nested inside each other. In such a case, if the handler of the child is clicked, the handler of parent will also work as if it were clicked too.

You can use the prototype pattern, adding each method and property directly on the object’s prototype.

function Employee () {}​Employee.prototype.firstName = "Abhijit";


Employee.prototype.lastName = "Patel";


Employee.prototype.startDate = new Date();


Employee.prototype.signedNDA = true;


Employee.prototype.fullName = function () {console.log (this.firstName + " " + this.lastName); };


​​var abhijit = new Employee () //​console.log(abhijit.fullName()); // Abhijit Patel​console.log(abhijit.signedNDA); // true

You can also use the constructor pattern, a constructor function (Classes in other languages, but Functions in JavaScript).

function Employee (name, profession) {​this.name = name;​this.profession = profession;


} // Employee () is the constructor function because we use the new keyword below to invoke it.​​​


var richard = new Employee (“Richard”, “Developer”) // richard is a new object we create from the Employee () constructor function.​​




console.log(richard.name); //richard​console.log(richard.profession); // Developer

How do yousort a collection in backbone

With Backbone.js, collections can be sorted by defining comparator on the collection object. By default, collections are not explicitly sorted. By defining a comparator, a collection is sorted whenever a model is added or the “sort()” method is invoked on a collection:




var Fruits = Backbone.Collection.extend({ comparator: function(a, b) { /* .. */ }})// Orvar Fruits = Backbone.Collection.extend({})var fruits = new Fruits()fruits.comparator = function(a, b) { /* .. */ }