Professional Documents
Culture Documents
Question:
What is a DTD? What DTD do you generally use? Why? Pros and cons.
Answer
Answer Rating:
Question
Answer
Font sizes should be declared using relative measurement values, such as ems, via a style
sheet, without the use of the term !important. There are issues with browser font size
enlarging which can be rectified via CSS.
Answer Rating
Question
a) What are the possible values for the display attribute that are supported by all
browsers?
b) What is the default value for the display attribute for the image element? (what is the
difference between inline and block level elements)
c)What does display: run-in do?
d) Difference between “visibility:hidden” and “display:none”? What are the pros and
cons of using display:none?
Answer
Answer Rating
1. Doesn’t know
2. Knows the answer to A
3. Knows the answer to A and D
4. Knows the answer to A, B and D
5. Knows the answer to C too!
Question
Answer
a) Values for position: static, relative, absolute, fixed, inherit
b) Static
c) They are placed relative to the next parent element that has absolute or relative value
declared
d) Absolutely positioned elements are removed from the document flow. The positioned
element does not flow around the content of other elements, nor does their content flow
around the positioned element. An absolutely positioned element may overlap other
elements, or be overlapped by them.
e) IE treats a position like a z-index reset, so you have to declare position of static on the
parent element containing the z-indexed elements to have them responsd to z-index
correctly.
Answer Rating
1. Doesn’t know
2. Knows 4 out of 5 answers in part A
3. Knows A & B
4. Knows A, B & C
5. Knows A-D
6. Knows E too
Question:
Write a snippet of CSS that will display a paragraph in blue in older browsers, red in
newer browsers, green in IE6 and black in IE7
Possible Answer:
#content p{color:blue}
html>body #content p {color:red}
* html #content p{color:green}
html>body #content p {*color:black;}
Answer Rating
1. Doesn’t know
2. Knows how to declare one color, but no hacks
3. knows the html>body hack and * html hack
4. Knows all the hacks, but doesn’t validate or uses conditional comments in the
HTML
5. Gives you the right answer and explains why the CSS won’t validate, or, uses a
valid hack, other than conditional IE comments, instead of the above answer.
Answer:
Answer Rating:
Question
Are the following all equal, and, if so, what would your code look like to make the
following all equal the same thing:
alert(document.forms["myform"].elements["field"].value);
alert(document.forms[1].elements[1].value);
alert(document.myform.field.value);
answer:
Answer includes knowing that the form is the second form on the page, and that the
field input element is the second element within that form.
Answer Rating
1. Doesn’t know how to code forms and doesn’t know that the first index of an array
is 0.
2. Knows either how to code forms with valid XHTML or that array starts at 0, but
not both.
3. Knows how to code forms but not correctly, but omits something like doesn’t
know that the form needs to be the second one on the page, and the element is the
second one in the form. Would know how to do it if they actually put thought into
it.
4. Codes the form correctly, but uses ID instead of name
5. Codes everything correctly
Question:
Possible Answer:
newParagraph = document.createElement('p');
newParagraph.setAttribute('class', 'myClass');
newText = document.createTextNode('this is a new paragraph');
newParagraph.appendChild(newText);
myLocation = document.getElementById('parent_of_new_paragraph);
myLocation.appendChild(newParagraph);
Answer Rating:
Q: How do you organize your CSS? How do you come up with id and class names (what
naming conventions do you use)?
A: While there are no right answers, there are best practices. Issues to look for are not
having div mania, no inline CSS, no presentational markup, minimal use of classes,
understanding the CSS cascade.
Q: What do you think of hacks? When should you use them? If you use them, how do
you maintain them? What can be done to avoid needing to use box-model hacks? (if they
aren’t pros, you can ask them what is the issue with x-browsers and the box model)
Q: What are the pros and cons of using tables for layout? Do you use tables? What are
the pros and cons of tableless design? How do you generally layout your pages?
A: check for them NOT using tables
Q: Check to ensure that they separate structure and semantics first from presentation
later? Do not ask about this during HTML, but do in webstandards.
Q: What are some deprecated elements and attributes that you use, and in what instances
do you use them?
A: List of deprecated elements and attributes.
Q: What is involved in making a website accessible? What are arguments you use to
convince others to invest in making their web site accessible.
A: See Making the web Accessible. Making sites accessible also makes them more
search engine friendly (saves money), makes your pages accessible to the 20% of the
population that has some type of disability (so you can make more money) and it’s the
law in many places.
Q: Define what web standards mean to you? How do you implement web standards?
Q: In CSS, how can you make a form elments background-color change when the user is
entering text? will this work in all browsers?
Q: How can you target an element in your HTML using the DOM?
XHTML Test
XHTML is fairly straight forward and anyone who could deal with the CSS test should
be able to breeze through this; however just to be thorough I wanted to go through this
exercise.
Answers