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 3 of 3

Thread: css inheritance

  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile css inheritance

    Hi experts,

    I have three css files (main.css, style81.css and style86.css) .

    On main.css. i have this script
    Code:
    body { background-image: url(/gfx/style/81/css-files/background_new_02.gif); background-color: #ffffff; padding: 0px; margin: 0px;

    On style81.css and style82.css, i have this script
    Code:
    @import url(main.css);

    The thing here, i want to use different background images on each stylesheets..

    is that possible? if yes, whats the best way to do it?

    Thank you

    Regards,

    Ed

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello guysoul,
    You could do that with an id or class on the body of each document. Like this:
    html - <body id="style1">
    css - body#style1 {}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,627
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Excavator, I think you have misunderstood guysoul. As far as I understand they just need to override the style in the other stylesheets, like:
    Code:
    @import url(main.css);
    
    body {background-image: [different image path];


  •  

    Posting Permissions

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