specifying different background-image to the default in 'body'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    specifying different background-image to the default in 'body'

    Hi,
    if I have a body colour (white) specified in an external css sheet,
    what should I do in an individual webpage that is to have a
    background-image, i.e. override the attribute 'white' set in the style
    sheet? Without having other attributes stated in body being forgotten
    by browsers.
    Do I have to link that page to a separate but nearly identical css
    sheet just for itself with only that 'background' difference?

    Thanks in advance,
    Dave
  • Beauregard T. Shagnasty

    #2
    Re: specifying different background-image to the default in 'body'

    Dave wrote:
    [color=blue]
    > if I have a body colour (white) specified in an external css sheet,
    > what should I do in an individual webpage that is to have a
    > background-image, i.e. override the attribute 'white' set in the
    > style sheet? Without having other attributes stated in body being
    > forgotten by browsers. Do I have to link that page to a separate
    > but nearly identical css sheet just for itself with only that
    > 'background' difference?[/color]

    No separate sheet needed. Just add this in the <head> section, after
    the link to the stylesheet.

    <style type="text/css">
    body { background-image: url("path/to/image.gif") }
    </style>

    ...or whatever else you want to override from the external file.

    --
    -bts
    -This space intentionally left blank.

    Comment

    • Mark Tranchant

      #3
      Re: specifying different background-image to the default in 'body'

      Dave wrote:
      [color=blue]
      > if I have a body colour (white) specified in an external css sheet,
      > what should I do in an individual webpage that is to have a
      > background-image, i.e. override the attribute 'white' set in the style
      > sheet? Without having other attributes stated in body being forgotten
      > by browsers.
      > Do I have to link that page to a separate but nearly identical css
      > sheet just for itself with only that 'background' difference?[/color]

      Either put a class on the body element and include the separate styling
      in the main CSS file, or include inline styling after the link to the
      external sheet.

      If you only specify the background-color, all of the other properties
      will cascade through.

      --
      Mark.

      Comment

      Working...