SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    over riding settings.

    Is there a way to set the background of an element to none?
    for example it is #000 in the full size screen
    but when after an @media query change i want the same div to have no background.
    or can i set the rgb to a neutral value? is there such a thing.
    thx
    D

  2. #2
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,516
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    If you want to remove a background color, you can use:

    Code:
    background-color:none;
    or

    Code:
    background:none;
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    fantastic
    for some reason i thought i had been told years that wasn't an option.
    created an addy class w/background none & it worked great.
    Thank you!!!

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,592
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    but when after an @media query change i want the same div to have no background
    Another option would be to set that background color in a media query that only targets larger screens.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,789
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Force Flow View Post
    If you want to remove a background color, you can use:

    Code:
    background-color:none;
    I'm afraid that won't work as there is no value called"none " for the background-color property. I think you meant to say transparent which will set it back to default.

    Code:
    body{
    	background-color:red;
    	background-color:transparent;
    
    }

    "none" is available for background-image which is why the shorthand works with "none".

    Code:
    background:none;
    "none" refers to the background-image and as usual with shorthand anything not specified will be reset to the default for which the default of background-color is transparent


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
  •