JavaSpartans
Java J2ee Struts Hibernate Spring Interview Questions Java J2ee Struts Hibernate Spring Interview Questions
27 Results; Time:0.037 Sec; Page : 1 ; Results From 1 to 10. Results Per Page

1. What is a Media Query in CSS?

Media query is a CSS technique introduced in CSS3.

It uses the @media rule to include a block of CSS properties only if a certain condition is true.

Example

If the browser window is 600px or smaller, the background color will be lightblue:

@media only screen and (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}


2. What is the difference between id and class od a DIV element in CSS ? When to use id and when to use class ?

In the CSS, a class selector is a name preceded by a full stop ('.') and an ID selector is a name preceded by a hash character ('#'). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.

3. I wrote a code <table width=800px> It comes accurate to in 15 inch monitor screen. But when I wrote same program in 17 inch monitor it comes half in the browser. So suggest me what the code I have to change so that it comes accurate in 15 inch computer as well as in 17 or 19 inch computer?

Just use width="100%" instead of 800px ; This will work for all kinds of resolutions.

4. What is meta-refresh tag ? How to use ?

usage of meta-refresh tag

<meta http-equiv="refresh" content="15;url=index.jsp"/>

After 15 seconds it will redirect to index page.

If you want to display some server maintenance notice you can display initially and then redirect to homepage after 15 secs

5. If we define local style and global styles which one will have effect ?

    There are three types of stylesheets:

    Internal - Placed right on the page whose interface it will affect.
    External - Placed in a separate file.
    Inline - Placed inside a tag it will affect.
    
    Properties of CSS: Inline CSS has the highest priority, then comes Internal/Embedded followed by External CSS which has the least priority.
    
    local style sheets have the highest priority than global.
    
    also, the last defined style have the highest priority in side a file.

6. How To Wait Before Redirecting To Another Page?Example is: If a user logs in failed because of invalid userid or password, I want display a message indicating the problem, wait about 30 seconds, then automatically redirect to login page again. or display some add for 30 seconds and then redirect request to the original page. What command or method should I use to wait 30 seconds ?

just use meta-refresh tag

<meta http-equiv="refresh" content="15;url=index.jsp"/>

After 15 seconds it will redirect to index page.


7. How many different types of ways to use a Style Sheet in our Tags ?

you can create id with # (hash) or a class with . (dot). or directly we can use style attribute in our tags, or create a local style tags or global style tags in a file called Style.CSS

8. What is the difference between RowSpan and CoulmnSpan attributes of HTML tags ?

If the rowspan property is given a value of 2, it will stretch across two cells horizontally. In short, colspan is used to merge 2 or more cells horizontally. And rowspan is used to merge 2 or more cells vertically.

9. What is the difference between cellpadding and cellspacing of HTML table tag ?

Cellspacing is the space between cells. Cellpadding is the space between the content inside the cell and its borders. Cell Spacing is used to set space between different table cells. CellPadding is used the space between the edges of the cell and the content of the cell.

10. What is the difference between DIV and SPAN tags of HTML ?

div - it is a dom element with display property as a block that is element will take the whole row that is with the line-break.

<div>Your name?</div>
<div>xyz</div>

will be displayed in two different rows. and each div will be considered as an individual block.

Your name?
xyz

span - dom element with display property inline that is without line-break.

<span>Your name?</span>
<span>xyz</span>

the result will be on the same line because of the span

Your name?xyz.


Other usage of span is you can apply different style in side a div element.

Java J2ee Struts Hibernate Spring Interview Questions
27 Results; Time:0.037 Sec; Page : 1 ; Results From 1 to 10. Results Per Page
Menu - javaspartans.com - Java J2ee Struts Spring Hibernate Interview Questions
Hostens.com - A home for your website
Ads By Google