douwuli4512 2012-03-22 06:54
浏览 66
已采纳

它与wordpress博客的PHP和css有关

I have installed a complete blank theme with no CSS in my new wordpress blog. I have been trying to give it a background image but no success.

I am working on blog's content. Blog is very new. So, until content is ready, I want just a background image to appear on my blog and have some text in the middle of the page.

I removed content from footer.php, I removed default post which you see when Wordpress is first involved. I removed content in searchform. php too. I want it all blank for sometime. just want a BG image and some text that displays in the middle of my blog.

I added this line in blank theme's style.css..its not working. ALso where do I add text so it displays in the centre?

body { background: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg')

Can some one please help me out here??

I do not know anything about PHP so I dont knwo where to add text. Please help me. Which php whould I add text to? and also this background image isnt still working. I changed "background" to "background-image" now

this is the only css file in my Wordpress blog as of now..I have been making changes in this only.

/*
Theme Name: BlankSlate
Theme URI: http://tidythemes.com/blankslate/
Description: BEFORE USING AND ESPECIALLY UPGRADING PLEASE READ: tidythemes.com/concept. The bare essentials of a WordPress theme, no visual CSS styles added. Perfect for those who would like to build their own theme from scratch or for clients if you're a developer or designer. This theme is clean, valid code, semi minified, no programmer comments, SEO-friendly and 100% open source. One custom menu and one widgetized sidebar to get you started. If you don't know CSS and would like to learn we've prepared: tidythemes.com/want-to-learn-css and please visit us in the forum for further help: tidythemes.com/forum - Thank You and Enjoy
Author: TidyThemes
Author URI: http://tidythemes.com/
Version: 2.0
Tags: custom-menu, featured-images, microformats, sticky-post, threaded-comments
License: GNU General Public License v2.0 | From TidyThemes: This theme is completely free and open source to use as you like for both personal and commercial projects without any limitations.
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
body { background-image: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg')  !important; no-repeat}
body { text-align: center !important;}
html{  margin-top:0px !important;}

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{font-size:100%;font:inherit;padding:0;border:0;margin:0;vertical-align:baseline}
body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}


.sticky{}
.bypostauthor{}
.wp-caption{}
.wp-caption-text{}
.gallery-caption{}
.alignright{}
.alignleft{}
.aligncenter{}
  • 写回答

2条回答 默认 最新

  • dsomm80482 2012-03-22 07:01
    关注

    As a quick fixing just apply important it should work. It will override existing background. But make sure your path is correct.

    body { 
        background: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg') !important;
        }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机