Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Image using CSS

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image using CSS

    I am using actie style sheet to change the CSS for my website. I have a different image for each CSS file chosen. What is the CSS code to specify the image path?

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    something like:

    Code:
    #element {
        background: #color (or transparent) url(the path to the image) background-positioning;
    }
    eg:
    Code:
    div#main {
        background: #fff url(images/mainbg.jpg) top left repeat-x;
    }
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,088
    Thanks
    2
    Thanked 23 Times in 23 Posts
    What harbingerOTV said, but also, if you are coding this for Firefox, define each attribute separately. For example:

    Code:
    div#main {
        background-color: #fff;
        background-image: url(images/mainbg.jpg);
        background-position: top left;
        background-repeat: repeat-x;
    }
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by vinyl-junkie
    What harbingerOTV said, but also, if you are coding this for Firefox, define each attribute separately. For example:

    Code:
    div#main {
        background-color: #fff;
        background-image: url(images/mainbg.jpg);
        background-position: top left;
        background-repeat: repeat-x;
    }

    Why?
    I develop in (and use) FF and invariably use the background shorthand property. I don't recall ever having any issues.

  • #5
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,088
    Thanks
    2
    Thanked 23 Times in 23 Posts
    That's what I was told on another forum. If your page displays for you fine in Firefox without having to make that change, that's great.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #6
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    vinyl-junkie,

    Weird. Have you ever had an issue with that? I haven't. My tooling on myspace is the only time I had to write it all out like that.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #7
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,088
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Quote Originally Posted by harbingerOTV
    vinyl-junkie,

    Weird. Have you ever had an issue with that? I haven't. My tooling on myspace is the only time I had to write it all out like that.
    I wasn't the one that had the problem with it, but someone else in another forum. That person told me my page displayed fine in IE but not FF and told me that the way I was doing my CSS was the problem in FF. I presumed, perhaps incorrectly, that all FF pages needed to have their CSS coded that way.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #8
    New Coder
    Join Date
    Dec 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    div#logo {
    background-color: #fff;
    background-image: url(images/logogreen.gif);
    background-position: top left;
    background-repeat: repeat-x;
    }

    So I've got this code. Is the html code to diplay the pic <div id=logo/> ?

  • #9
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ningo
    div#logo {
    background-color: #fff;
    background-image: url(images/logogreen.gif);
    background-position: top left;
    background-repeat: repeat-x;
    }

    So I've got this code. Is the html code to diplay the pic <div id=logo/> ?
    <div id="logo">&nbsp;</div>

    But you'd probably have to set a width and height to the div as well, and I'm not quite sure how it'd display on MySpace.


  •  

    Posting Permissions

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