CSS / Style Isolation / Reset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JimLiu
    New Member
    • Mar 2008
    • 1

    #1

    CSS / Style Isolation / Reset

    Hi,

    One of my website has a page that has a part is generated from user input. Users are allowed to input some simple HTML code like <b>, <i>...etc. One of the problem is that if a user input is incomplete (like <b><i>test</i>), the rest of the page (static content) will be affected (in the case be bold).

    Is there anyway I can isolate all HTML / CSS styles to that section of the webpage (maybe a DIV)? Or perhaps I can reset the style and apply new style on other part of the webpage?

    Any idea would be appreciated. Thanks!
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Not sure if this is what you are looking for. You can wrap that part of the content in a div and assign it an 'id'. Then, in CSS, you can assign that styling to that div only.
    [code=css]
    #visitor_markup p {background-color:#ccc; font-size:24px}
    [/code]
    [html]
    <div id="visitor_mar kup">
    <p>I am a dopey visitor</p>
    </div>
    [/html]

    Comment

    Working...