CSS and Html question -


i found page of web developer interview questions, , i'm not sure answers 2 of them. q1, pick answer e. q2, pick answer b, i'm not sure if there better ways it.

  1. which markup structure semantic title within document body, considering title may horizontally centered using large, bold, red font?

    a. <h1>this title</h1>

    b. <p align="center"><font size="+3"><b>this title</b></font></p>

    c. <h1 style="font-weight:bold; font-size:large; text-align:center; color:red;">this title</h1>

    d. <title>this title</title>

    e. <h1 class="largeredboldcenterheading">this title</h1>

    f. <span class="title">this title</span>

  2. are each of following footer markup solutions acceptable? why or why not? alternate solution(s) propose?

    a. <div id="footer">
    copyright 2010 company | text arbitratry.
    </div>

    b. <div id="footer">
    <p>copyright 2010 company | text arbitratry.</p>
    </div>

the correct answer 1. a should have 1 h1 tag on page (so class unnecessary if it's h1) , because class used in e not semantic (e.g. "title") instead describes particular styling useless if later changed way want display title.

in fact can rule out other options this:

  • b) uses align attribute, uses font tag, uses b tag (this 1 iffy prefer used em), uses p tag heading.

  • c) uses inline styles

  • d) uses title element in body try , render content. belongs in head , shouldn't display on page anyway if incorrectly , invalidly placed in body.

  • e) uses class poorly named. classes should describe meaning of class (e.g. "emphasisedheader", "helpbutton" etc. ) , not how class rendered. think of them tag - <largeredboldcenterheading> tag or <emphasisedheader> tag?

  • f) invalid html

for question 2. answer trickier. p tag unnecessary div block element default.

in html 5 there footer element this, , indeed 1 of more attractive abandoned proposals on allow name element (perhaps using own "meta-doctype") , have them render div (e.g. have <adbox> tag instead of <div class="adbox">).

it argued should in <ul id="footer"> each element in <li>, attempting style | divider painful in compliant , cross-browser fashion.

i happy a.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -