WordPress.org

Ready to get started?Download WordPress

Forums

default background color issue (34 posts)

  1. rezabarca
    Member
    Posted 1 year ago #

    I add this code to my fuction.php child theme for custom background color but when i change the color and save, after refresh it turned back to defult color . why? notice: i use wordpress 3.5.1

    add_theme_support( 'custom-background', array(
    		// Let WordPress know what our default background color is.
    		'default-color' => '#0000ff',
    	) );
  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Do you have a background colour set in the dashboard?
    Is there CSS setting the background colour?

  3. rezabarca
    Member
    Posted 1 year ago #

    Yes , in the dashboard -> appearance ->background ->custom background
    and about the css there is just
    body {background-color:#0000ff;}

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Have you cleared your cache?
    If so, can you link the webpage with the issue?

  5. rezabarca
    Member
    Posted 1 year ago #

    I am using localhost

  6. rezabarca
    Member
    Posted 1 year ago #

    how i can clear the cache ?

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Which browser are you using?

  8. rezabarca
    Member
    Posted 1 year ago #

    chrome

  9. Andrew
    Forum Moderator
    Posted 1 year ago #

    See if you can hold down the refresh button to see the option 'hard refresh and clear cache'.

    Otherwise go to options > history > clear all browsing data > Empty the cache from the beginning of time.

  10. rezabarca
    Member
    Posted 1 year ago #

    i deleted the cache but the problem exist yet

  11. Andrew
    Forum Moderator
    Posted 1 year ago #

    Can you provide the HTML of one page by linking us to a PasteBin page where it resides?

  12. rezabarca
    Member
    Posted 1 year ago #

    i clicked on the pastebin and send it

  13. Andrew
    Forum Moderator
    Posted 1 year ago #

    Thanks, can you post a link here?

  14. rezabarca
    Member
    Posted 1 year ago #

  15. rezabarca
    Member
    Posted 1 year ago #

    i send the link

  16. Andrew
    Forum Moderator
    Posted 1 year ago #

    Thanks, now can you do the same but provide us with your CSS for that one webpage?

  17. rezabarca
    Member
    Posted 1 year ago #

    i send all of the css codes

  18. rezabarca
    Member
    Posted 1 year ago #

    /* CSS Document */
    
    html, body, table, th, tr, td, p, img, hr, ul, li, h1, h2, h3, h4, h5, div, form, fieldset {padding:0; margin:0; border:none;  }
    
    /* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,
    img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,
    tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,
    summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,
    figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}
    blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}
    table{border-collapse:collapse;border-spacing:0}
    
    body {background-color:#0000ff;
          font: Arial, Helvetica, sans-serif; size:20px; color:#ffffff; line-height: 1.5;
    	  }	  
    
    A:link{text-decoration: none; color:#0bbcf6;}
    A:visited {text-decoration: none; color:#00e741;}
    A:active {text-decoration: none; color:#00e741;}
    A:hover {text-decoration: underline; color: red;}	  
    
    #main {
       background:#000000;
       width:1000px;
       height:1200px;
       margin:auto;
       border:solid 1px #0000FF;
       }
    
    #header {
       width:1000px;
       height:30px;
       border-bottom:solid 1px #0000FF;
       margin:auto;
     }
    
    #container {
       width:780px;
       height:750px;
       margin-top:100px;
       float:right;
       border-top:solid 1px #0000FF;
       border-left:solid 1px #0000FF;
       border-bottom:solid 1px #0000FF;
       font-family:hobo std;
       letter-spacing:1px;
       padding:10px 0 0 10px;
    
       }  
    
    #sidebar {
       border-right:solid 1px #0000FF;
       border-top:solid 1px #0000FF;
       border-bottom:solid 1px #0000FF;
       margin-top:100px;
       width:180px;
       height:750px;
       float:left;
       color:#ffffff;
    
       }
    
    #footer {
       width:1000px;
       height:200px;
       border-top:solid 1px #0000FF;
       margin-top:970px;
       background-color:#222226;
       }
    nav {
       margin:0px 50px ;
    
    }
    nav ul li {
          display:inline-block;
    	  *display: inline;
        zoom: 1;
          font-family:hobo std;
    	  margin:7px 5px 5px 5px;
    
    }
    nav ul li a {
          padding:20px 30px;
    	  color:#0000ff;
    	  text-decoration:none;
    }
    
    .widget {
      border-bottom:solid 1px #0000FF;
      clear:both;
      padding:10px 8px 10px 10px;
      font-family:hobo std;
      color:#87d6f7;
      letter-spacing:0.5px;
    
      }
    
    ul li {list-style-type:none;}
    
    #commentdiv { margin-top:200px;}
  19. Andrew
    Forum Moderator
    Posted 1 year ago #

    Your black background is not coming from the <body> tag, it's coming from <div id="main">.

    In Google chrome, view your webpage and right click on the black background just below the navigation.

    Select 'Inspect element'.

    In the new toolbar, look on the right hand side.
    [screenshot]

  20. rezabarca
    Member
    Posted 1 year ago #

    i watn to change the background color of body. the blue color

  21. Andrew
    Forum Moderator
    Posted 1 year ago #

    Did you try removing the black background colour on <div id="main">?

  22. rezabarca
    Member
    Posted 1 year ago #

    why i must remove it ?

  23. Andrew
    Forum Moderator
    Posted 1 year ago #

    Why not?

  24. rezabarca
    Member
    Posted 1 year ago #

    i remove it and after refresh it turn back to blue

  25. Andrew
    Forum Moderator
    Posted 1 year ago #

    Is that what you want?

  26. rezabarca
    Member
    Posted 1 year ago #

    no . i wat to chand the background of the body.not the main <div>
    i want to change it from the wordpress , not from the css

  27. Andrew
    Forum Moderator
    Posted 1 year ago #

    You did change the <body> to blue.
    The reason why your page was black was because of the CSS applied to <div id="main">.

  28. rezabarca
    Member
    Posted 1 year ago #

    i said i want to id="main" color to be black. i want to change the color of the body tag . the blue color . from the wordpress dashbord , not from css

  29. rezabarca
    Member
    Posted 1 year ago #

    please read my first post again

  30. Andrew
    Forum Moderator
    Posted 1 year ago #

    What turned back to the default colour, the webpage?

Topic Closed

This topic has been closed to new replies.

About this Topic