Midterm Practice Flashcards
How do we select the id attribute in css?
“#id”
How do we select the class attribute in css?
.class
What does “p” select in css?
Selects all the paragraphs
What does “p” select in css?
Selects all the paragraphs
What does “div p” select is css?
Selects all paragraphs inside div elements
What does “div, p” select in css?
Selects all the div and p tags
What does “div+p” select in css?
Selects all the sibling p tags that immediately follow a div tag
“<div></div>”
“<p></p> <– this one–>”
“<p></p> <– this does not follow a div –>”
What does :hover do in css?
Applies a style to an element when the mouse is over it
Code test:
<?php
$pass = “test”;
$hash1 = password_hash($pass, PASSWORD_BCRYPT);
$hash2 = password_hash($pass, PASSWORD_BCRYPT);
if($hash1 == $hash2){
echo “matches”;
}
else{
echo “doesn’t match”;
}
?>
doesn’t match (random salt is assigned during hash to prevent two or more users from having the same password key)
What does == do?
Value equality matches but not type
What does === do?
Value AND type equality
What does $x++ do?
Increments x by 1
What does $x– do?
Decrements x by 1
What does && do?
Logical AND (both conditions must be true)
“What does || do?”
Logical OR (either condition must be true)
What does ! typically do in !$x?
Negates it (flips the boolean or truthy value)