Menu

#174 output IDs to HTML

output: HTML
open
nobody
XSL (399)
3
2006-04-13
2003-10-16
No

A member of the mailing list suggested an option to the
HTML stylesheets that will copy the ID attribute of an
element to its respective <div> or <span> element in the
HTML output. That would permit CSS styling of individual
elements using a selector based on ID.

Discussion

  • James Ascroft-Leigh

    Logged In: YES
    user_id=924230

    I would like to extend this request to move the id
    attributes used as the fragment identifiers in hrefs to a
    containing <div/> element.

    The reason for this is, at the moment, probably not too
    important: when the user clicks a hyperlink witha chapter
    name, for instance, I think they expect to be presented with
    the entire chapter instead of just the title of the chapter.

    Current implementation of web browsers would behave in a way
    that the user would not distinguish from the current
    behaviour but future implementations may me more
    intelligent. An example of this is the new :target [1]
    pseudo-class introduced into CSS3 [2] that seems to already
    be implemented in Mozilla Firebird [3]. This selects the
    element with the id corresponding to the fragment identifier.

    I would like to apply a different style (like a highlight or
    a border) to these :target elements to make it clearer what
    the hyperlink points to but, at the moment, I am only able
    to highlight the title of chapters instead of the entire
    chapter.

    If the containing <div/> for the chapter were the :target
    then I could still highlight only the title of it using the
    :target > .title or something similar.

    [1]
    http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#target-pseudo
    [2] http://www.w3.org/Style/CSS/current-work
    [3] http://www.mozilla.org/products/firebird/

     
  • Michael(tm) Smith

    • priority: 5 --> 7
     
  • Michael(tm) Smith

    • milestone: --> output: HTML
     
  • Michael(tm) Smith

    Logged In: YES
    user_id=118135

     
  • Michael(tm) Smith

    • priority: 7 --> 3