Friday 29 May 2020

CSS3 interview questions and answers for experienced

css3 interview questions and answers for experienced



Question: How to write conditional statement in CSS?
<!--[if IE 7]>
<style type="text/css">
div.abc {                 
    background-color:red;
}
</style>
<![endif]-->



Question: How to write styles for all html elements of the same type?
Use tag name to write the CSS.
See Example
h1{font-size:18px;}
h2{font-size:17px;}
h3{font-size:16px;}
h4{font-size:15px;}



Question: What are different vaules of position attributes?
absolute
fixed
inherit
relative
static


Question: How to display a link without underline using CSS?
 a{
    text-decoration:none;
}



Question: How to display a link without underline when mouseover on the link using CSS?
 a:hover{
    text-decoration:none;
}



Question: How to page break after an html element in CSS?
<div style="page-break-after: always;">
Web Technology Experts Notes</div>



Question: What is the default value of "position" attribute in css?
static


Question: How we can specify more than one css class for any HTML element?
<div class="class1 class2">
Web technology experts Notes</div>




Question: Is CSS case sensitive?
No


Question: What is ID selector?
ID selector is an individually identified selector to which a specific style is declared.



Question: How to set wait cursor?
div.click{
    cursor:wait;
}




Question: What is Tweening ?
It process of generating intermediate frames between two images to give the appearance that the first image evolves smoothly into the second image.

Question: What are Child Selectors?
A child selector is used when you want to match an element that is the child of another specific element.
div.abc > ul {font-weight: bold;}



Question: What are different ways to apply styles to a Web page
Inline
Embedded
Linked
Imported



Question: What is contextual selector
Contextual selector addresses specific occurrence of an element.




Question: How to disable text selection highlighting with CSS?
.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

Add the .noselect to the html tag





Saturday 18 April 2020

How to check if a number is prime?

How to check if a number is prime?


Question: What is Prime Number
A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.


Question: Give the example of Prime Number
2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.


Question: Write an function that check the prime number OR Not?
function checkPrime($number){
    if($number < 0 ){
        return false;
    }
    $return=true;
    for($i=2; $i < $number; $i++){
        if($number % $i ==0){
            $return=false;
            break;
        }
    }
   return $return;
}



Question: How to check a number is prime Or Not?
echo checkPrime(2)?'Prime':'Not Prime'; //Prime
echo checkPrime(4)?'Prime':'Not Prime'; //Not Prime
echo checkPrime(6)?'Prime':'Not Prime'; //Not prime
echo checkPrime(7)?'Prime':'Not Prime';  //Prime


Question: What are the prime numbers between 1 to 100?
for( $i = 2; $i < 100; $i++ ){
    if( checkPrime( $i ) ){
        echo $i;
        echo ',';
    }
}