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;
    }
CSS3 Tutorials with all Tags

CSS3 Tutorials with all Tags

Cascading Style Sheets (CSS) is a style sheet language
and it was used for presentations  look and formatting of a document written in a Hyper Text Mark up Language.
It’s most common application is to style web pages written in HTML and XHTML.

Please download the attached PDF document for its tags and tutorials.

 

PHP Class abstraction and Interfaces

PHP Class abstraction and Interfaces

Class Abstraction
=================

PHP 5 introduces abstract classes and methods. It is not allowed to create an instance of a class that has been defined as abstract. Any class that contains at least one abstract method must also be abstract. Methods defined as abstract simply declare the method’s signature they cannot define the implementation.

When inheriting from an abstract class, all methods marked abstract in the parent’s class declaration must be defined by the child; additionally, these methods must be defined with the same (or a less restricted) visibility. For example, if the abstract method is defined as protected, the function implementation must be defined as either protected or public, but not private.

Interfaces
==========

Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.

Interfaces are defined using the interface keyword, in the same way as a standard class, but without any of the methods having their contents defined.

All methods declared in an interface must be public, this is the nature of an interface.

To implement an interface, the implements operator is used. All methods in the interface must be implemented within a class; failure to do so will result in a fatal error. Classes may implement more than one interface if desired by separating each interface with a comma.

interface Inter1

{

}

Local storage and offline applications in HTML 5

Local storage and offline applications in HTML 5

Web developers have traditionally used cookies to store information on a visitor’s
local machine, allowing a Web page to read this information back at a later point.
While cookies are very useful for storing basic data, they are limited by the fact that
Web browsers are not required to keep more than 20 cookies per Web server or
more than 4KB of data per cookie (including both name and value). In addition, they
are sent to the Web server with every HTTP request, which is a waste of resources.
HTML5 provides a solution for these problems with the Local Storage APIs, which
are covered in a separate specification to the main HTML5 document. This set of
APIs allows developers to store information on the visitor’s computer while remaining
reasonably confident that they will still be there at a later date. In addition, the
information is accessible at any point (even after the page has rendered) and is not
loaded automatically with each HTTP request. The specification includes
same-origin restrictions, which prevent Web sites from reading or changing data
stored by other Web sites.

Most browsers store Web pages in local cache, allowing them to be viewed even if
the user is offline. This works fine for static pages, but it is not available for dynamic
content that is typically database-driven, such as Gmail, Facebook, or Twitter.
HTML5 provides support for offline applications, where the browser downloads all
the files necessary to use the application offline, and when the user uses the
application offline, the browser can allow any changes made in the process to be
uploaded to the server when they reconnect to the Internet.

Create a Page that Displays Random Posts

Create a Page that Displays Random Posts

Hi WordPress has an inbuilt option to show the recent posts as an home page. but not the random posts
what if you want the same look on other pages ?
here we have solution for the problem.

How to Create a Page that Displays Random Posts Have you ever been to a site and saw this cool feature?
They have a link in their top navigation to something like Random! or Read Random Articles, or some other creative text.
When you click on that link, it takes you to a page that displays one random page.
Each time you refresh, you are delivered with a new post.

Well this trick is just for you then. You would need to follow the trick #1 in this article to create a custom page template.
And simply paste this code in there:

 

 

This is a simple WordPress Loop that is running a query to display random posts and the number 1 in there is telling WordPress to only show 1 post.
You can change that number, but most of the time people do it one post a time.
We have a Quick Reading Page on our site as well, so you can see this trick in action.