SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disable css in specific portion of code ?

    Hi,
    css are in css files, and affect all pages.

    Are there anyway to disable all css effects on specific portions of code within a page ?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    A solution can be to create a javascript code that rewrite the css properties for elements in the portion you want.
    Or, to add inline "style" to those elements, that rewrite the properties added in css file.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Posts
    31
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Koros View Post
    Hi,
    css are in css files, and affect all pages.

    Are there anyway to disable all css effects on specific portions of code within a page ?
    I dont know if its what you want, but why not create a class with a "reset" css and use it on the portion you want to?

  4. #4
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,821
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Over complicating things. And using .js to disable part of you CSS is counter intuitive.. Imean what if .js is off and the CSS is vital to the layout?

    Simplest way is have separate links. You could also create siv files for each type of HTML page and use @import.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,323
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Koros View Post
    Are there anyway to disable all css effects on specific portions of code within a page ?
    It would help to know why you are trying to do this. Even if you disable all of your own styles, the browser will apply its own styles. So you are better off deciding how you want certain elements to appear and style them accordingly—even if that means to style them as if they aren't styled ... so to speak.

  6. #6
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,889
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    @Koros

    Are there anyway to disable all css effects on specific portions of code within a page ?

    Try this:

    PHP Code:

    <div style='display:none;visibilty:hdden'>

       <!-- 
    script you want disabling -->

    </
    div
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014


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
  •