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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS and rotating header

    Hi all

    I have the following that specifies the header image:

    .header {
    background: url(img/header.jpg) no-repeat;
    height: 180px;
    margin: 0 auto;
    width: 630px;
    }

    Is it possible to have this code specify a different header image for each html page?

    Thanks in advance!

  • #2
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    I believe the <style> tag will override an external stylesheet, so in between your <head> and </head> place this and change it on every page:

    Code:
    <style type="text/css">
    .header { background: url(img/header2.jpg); }
    </style>
    .
    .

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks mate, worked like a charm:


    .header {
    background: url(img/headers/state_1.jpg);
    }

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by Jutlander View Post
    I believe the <style> tag will override an external stylesheet,
    Not necessarily.

    Presuming you mean embedded CSS. (External CSS can be @imported via style elements)...

    It depends in which order you add the external stylesheet and embedded styles to the document.
    If you add the external stylesheet after the embedded styles, then the external stylesheet will win over the embedded rules whenever property conflicts occur.
    If the embedded CSS comes after the external stylesheet in the markup, then the embedded CSS will win over whenever property conflicts occur.


  •  

    Posting Permissions

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