SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text box with Background image?

    I'm very new to CSS, and I wanted to know if it's possible to use a background repeating image for a text box? I see that a background color is possible, but have not seen anything about using a repeating tile.

    Thanks,
    Candle

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is possible, sure. Simply use the background-image property (or the background shortcut if you prefer).

    Playing a bit I found a strange thing, though. With IE and NS6.2 there were no problems, but with Mozilla(1.2) I got a surprising behaviour: if only a background image is specified, it doesn't have any effect. But if a background color is also provided (which, by the way, should always be done), the image is then correctly displayed. ?? Anyone knows why?

    Good luck with your CSS progress!

  3. #3
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by dense13
    Playing a bit I found a strange thing, though. With IE and NS6.2 there were no problems, but with Mozilla(1.2) I got a surprising behaviour: if only a background image is specified, it doesn't have any effect. But if a background color is also provided (which, by the way, should always be done), the image is then correctly displayed. ?? Anyone knows why?
    Not sure exactly why, but W3C have decided that some shorthand attributes require a minimum number of attributes in order to validate (and work).
    Passing an under-sepcified shorthand attribute through the W3C's online css validator returns an invalidation notice due to "too few values for the property".

    e.g. font shorthand attribute requires at least two values to be set in order to validate.

    font: Georgia; or font: 12px; will neither validate nor work on the more adherent browsers (Moz,...), though font: 12px Georgia; will both validate and work.

    While I am aware that this is the case, I have not searched the W3C site (or any other) thoroughly enough to have yet found out exactly *why* this has been implemented and perhaps more confusingly, why it seems that it has been implemented for *some* shorthand attributes and not others (such as background(?) and margin).

    So the bottom line is that it is meant to be that way.
    It is those browsers that currently still accept and use 'under-valued' css shorthand attributes that will be adopting a more strict approach to handling css shorthand with each new release.

    ...presumably.
    Last edited by Bill Posters; Dec 27, 2002 at 11:58.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  4. #4
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the information, and I'll be sure to specify a background color as well when I give this a try.

    Candle


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •