Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Giving the html-element an id and a class

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25646
    runa
    Member

    Hi there!

    My website contains two types of pages: Besides that normal ones that are long and scrollable, I have have those short ones whose content fits into a standard sized window. I use two navigations on these pages, one in the top-right corner and the other one in the bottom-left corner, so I have to give the < html >-element:

    Code:
    html { overflow: hidden; height: 100%; }

    in order to get rid of the scrollbars and to avoid shivering of divs positioned at the bottom or right edge. The top-left one would shiver and flicker when hovering over the bottom-right one, because the vertical scrollbar is displayed for the time of hovering. This does not work, when the above attributes refer to the body-element, and I cannot use the great technique of giving the body an id or a class.

    My question is: Can I give the html-element an id or a class without any unforseen consequences? As far as I know, the < html >-element is the Eva of all elements in the DOM and the body element is her first child. My htmls look like this

    Code:

    and it would look like this

    Code:

    Is there anything that the html-element is sacrosanct for ids and classes?

    Thanks! Runa

    #61777
    runa
    Member

    Thanks! I made a page and a css-file today. It works fine in the browsers.They treat it like a normal element. But the w3c-validator tells me, id’s would not be allowed on the html-element in XHTML 1.0 Strict.

    On one hand: You can solve it by splitting the css-file in two files.

    On the other hand: If the browsers and the googlebot won’t complain, why not giving it a try. I also use unallowed tags in the title-attribute for tooltipping, eg the BR or complete ULs.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.