SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    class that cant be overwrote

    I run a community web site. Members are allowed to design their own page. On the top of each member page, there is a default header. Here's my problem:

    Many members have changed the way the header looks; e.g. background colors, font sizes, etc. Is there a way for me to prevent this?

    I still want to the format <tag class=myclass>, as opposed to adding a style="parameters" in those tags. I just want to prevent people from redefining the header classes.

    Thanks,
    dave

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Apr 2003
    Posts
    4,095
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Important!

    Hello,

    Yes. Add the Important attribute to each item in the class, like this:
    Code:
    .Sample
    {
    color: #CCCCCC !important;
    border-bottom: solid 1px #CCCCCC !important;
    }
    I hope that helps.

    Compuwhiz7
    Last edited by cfm; Nov 6, 2003 at 07:50. Reason: My code was invalidly structured.

  3. #3
    SitePoint Evangelist S7even's Avatar
    Join Date
    Jun 2002
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The above would work but it should be like this:
    Code:
    color: #CCCCCC !important;
    (semicolon after !important)

    But if your users use important as well then they may again be able to override your style.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Apr 2003
    Posts
    4,095
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Oops.

    Hello,

    Thanks, Seven. I edited my post.

    Compuwhiz7

  5. #5
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome! Thanks a lot guys. I've never even seen that tag before.. haha

    Where do you guys learn all this?

  6. #6
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, I meant just pick these tidbits up in general.

    ===
    I'm running into some problems. When I link to a stylesheet and use the "!important" attribute, it doesn't seem to work. However, if its not linked, it does.

    Can I link to it and get it to work? I basically don't want people seeing the "important!" attribute that easily... heh.

    ===
    Also, does this attribute apply to ids as well?
    Last edited by dtang4; Nov 6, 2003 at 16:42.

  8. #8
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) are you using the corrected version? (compuwhiz7's original post had the syntax wrong, and s7even corrected it)

    2) could you link to the page, so we can have a look?

  9. #9
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also have you spelt it right, in you post you use both !important and important!. The first is the correct one.

  10. #10
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, everything looks different... heh.

    Thanks for the help. Everything seems to be working now, for some reason. I didn't even change anything... just re-uploaded and refreshed a few times, heh.

    Thanks again.


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
  •