Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Exclude a CSS rule defined on an HTML tag

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42361
    renu318
    Member

    Hi all,

    div
    {
    font-size:14px;
    font-family:Times New Roman;
    position:relative;
    float:left;
    }

    That is a css rule applied in a page that I need to work. I have no control over altering that. Now I need to put a div element in the page to which those rules should NOT apply. How do I do that? Any help is greatly appreciated.

    Thanks in advance,
    Renuka Prasad.

    #122813
    Kitty Giraudel
    Participant

    Three options here:
    * Don’t use a div
    * Override styles with higher specificity
    * Use the !important hammer bash

    I’d go with the 2nd one I guess.

    #122815
    renu318
    Member

    Thank you for the quick response Hugo :)
    How do I override that CSS rule? (Assume target browsers are all CSS2 compliant)

    #122819
    wolfcry911
    Participant

    Can you class your new div and add css to target that class?

    #122820
    Kitty Giraudel
    Participant

    What @Wolfcry911 said. You could also use an ID even if I wouldn’t recommand it.

    #122829
    renu318
    Member

    Thank you Wolfcry and Hugo, did it with a different class.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.