Web Designer interview Questions

Web Designer interview Questions

  1. How do you place two paragraphs next to each other?
    1. Float one or both inner divs with float left and width
  2. What is CSS declaration?
    1. A declaration is made up of a property name and a value, separated by a colon
  3. What are CSS pseudo-classes?
    1. CSS pseudo-classes are used to add special effects to some selectors.
      1. Selector:pseudo-class {property:value;}
      2. selector.class:pseudo-class {property:value;}
      3. Example : a.red:visited {color:#FF0000;}
  4. Can Style Sheets and HTML stylistic elements be used in the same document?
    1. yes
  5. I made a 10px-height div, but IE makes it 20px height how to solve this ?
    1. when you make a div just to contain the bottom border of a box solution is make font size is zero
  6. What is grouping in CSS?
    1. If you want to apply same styles to few properties then grouping is best to use the syntax is below
      1. .copyright, .tagline, .hint {font-style: italic}
  7. What is parent-child selector?
    1. Parent-child selector is a selector representing the direct descendent of a parent element. Parent-child selectors are created by listing two or more tilde (~) separated selectors.BODY ~ P {background: red; color: white} The P element will be declared the specified style only if it directly descends from the BODY element:<BODY> <P>Red and white paragraph </P> </BODY>
  8. What is cascade?
    1. Cascade is a method of defining the weight (importance) of individual styling rules thus allowing conflicting rules to be sorted out should such rules apply to the same selector.
  9. Is Style Sheets case sensitive?
    1. No
  10. How to include comments in Style Sheet?
    1. Syntax: /* This is a CSS-comment */
  11. How do you target a certain browser?
    1. IE can be targetted by preceding your properties with ‘* html’. For example…
      #nav {position:relative;}
      * html #nav { /* this will target IE */
      position:absolute; }

    2. and the second way is
      <!--[if IE]> <link href="ieonly.css" rel="stylesheet" type="text/css"> <![endif]—>
  12. What is !important ?
    1. It will override declarations with normal weight .
  13. Can CSS be used with other than HTML documents?
    1. Yes. CSS can be used with any structured document format.
  14. Which characters can CSS names contain ?
    1. A to Z, a to z, 0 to 9 and Unicode characters 161 to 255
  15. How do you make a tool tip that appears on hover?
  1. <a title="This is some information for our tooltip." class="tooltip">CSS3 Tooltip</a>
    .tooltip
    {
    display: inline;
    position: relative;
    }

    .tooltip:hover:after{background: #333;
    background: rgba(0,0,0,.8);
    border-radius: 5px;
    bottom: 26px;
    color: #fff;
    content: attr(title);
    left: 20%;
    padding: 5px 15px;
    position: absolute;
    z-index: 98;
    width: 220px;
    }