SitePoint Sponsor

User Tag List

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

    Overriding the outer div

    Hello,
    If I have main.html like below
    <div id="main">
    <div id="header">
    </div>
    <div id="content">
    ------------ Here is where my subpages are shown
    </div>
    </div>

    This theme is common across all pages but if I have a sub page "user.html" that requires a change to the outer div "main" like set the background color to black then how do I accomplish this change without affecting other pages.

    Thanks,

  2. #2
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Add an ID to whatever it's parent is (body?)

    <body id="user">

    Then for css:

    #user #main { background:#000; }

    Probably the simplest approach. The parent ID lets you override specificity quite easily.


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
  •