Runescape Bits & Bytes
https://www.rsbandb.com/forums/

css
https://www.rsbandb.com/forums/viewtopic.php?f=14&t=77417
Page 1 of 1

Author:  banikian [ November 20th, 2009, 2:29 am ]
Post subject:  css

How can i restrict one part of the code in html without getting affected by css without modifying .css file. It;s like disabling style changes for the particular block in html. i need to do for a div.
__________________
market samurai ~ marketsamurai ~ marketsamurai.com

Author:  Adbot [ November 20th, 2009, 2:29 am ]
Post subject:  Register and login to get these in-post ads to disappear


Author:  Chief Snake [ November 20th, 2009, 3:27 am ]
Post subject:  Re: css

I think the most straightforward answer is that you can't simply disable the CSS for a single element. You'd need to give it some CSS to reset its styles manually, which can be fairly easy to do if you use something like Firebug. Firebug can show you all of the CSS properties that an element has been given, so from there you would just go through each of the properties and negate them.

Author:  Aquw VettelS 776 [ November 20th, 2009, 5:14 pm ]
Post subject:  Re: css

Like this?

<div style="none">

Author:  Chief Snake [ November 20th, 2009, 5:48 pm ]
Post subject:  Re: css

That won't do anything? :-s

Author:  Aquw VettelS 776 [ November 24th, 2009, 11:33 am ]
Post subject:  Re: css

style="none" overrides other CSS styles, therefore the block in question receives no styling.

Author:  Chief Snake [ November 24th, 2009, 7:02 pm ]
Post subject:  Re: css

Are you sure? That shouldn't logically work and it doesn't for me having tested it. :P

When you add to the style attribute, the correct notation is style="property: value". This is the same as writing in a CSS file:
element (selector) {
    property: value;
}

By writing "none" where "property: value" is expected, the CSS is invalid. This could potentially cause the CSS to break and this may be where you find that style="none" works, but it doesn't seem to for me; it just has no effect.

Author:  Adbot [ November 24th, 2009, 7:02 pm ]
Post subject:  Register and login to get these in-post ads to disappear


Author:  addiv [ November 25th, 2009, 2:58 am ]
Post subject:  Re: css

Wouldn't adding style="" to all styled elements take care of this?

Author:  Chief Snake [ November 25th, 2009, 1:10 pm ]
Post subject:  Re: css

No as you'd only be adding to the styles already present. If a style attribute is left blank then you're not adding anything; the style is untouched. The style attribute in HTML does have precedence over any externally applied CSS though so all you need to do is negate the current styles from there (unless you've used !importants.. those are messy but just add some more and you'll be fine :P ).

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/