搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Error when using CSS selector

  • 9 个回答
  • 2 人有此问题
  • 4 次查看
  • 最后回复者为 Star Light

more options

It really trouble. I think "background-image" selector has an error, when I type right statement it is not working. Image doesn't appear on background, but when I make 1 wrong statement (any-statement, HTML or CSS) then "background-image" selector works?!

Could anyone explain me why it be like this? :'(

Here is my code use for my Thimble:

<style>
      body {
        background-image: url(http://takeinsocialmedia.com/wp-content/uploads/2014/04/norway-mountain-river-images-photos-0321205905.jpg);
        background-size: 100%;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: scroll;
        margin: 0;
        padding: 0;
        font-family: Tahoma, Arial
      }
</style>
It really trouble. I think "background-image" selector has an error, when I type right statement it is not working. Image doesn't appear on background, but when I make 1 wrong statement (any-statement, HTML or CSS) then "background-image" selector works?! Could anyone explain me why it be like this? :'( Here is my code use for my Thimble: <pre><nowiki><style> body { background-image: url(http://takeinsocialmedia.com/wp-content/uploads/2014/04/norway-mountain-river-images-photos-0321205905.jpg); background-size: 100%; background-position: center; background-repeat: no-repeat; background-attachment: scroll; margin: 0; padding: 0; font-family: Tahoma, Arial } </style></nowiki></pre>

由cor-el于修改

所有回复 (9)

more options

Hi, Try like this

  • background-image: url(http://thisisanimage.jpg);

More to know about Thimble CSS Cheat Sheet

more options

Sorry, I didn't give clearly my problem, am I?

<style>

     body {
       background-image: url(http://takeinsocialmedia.com/wp-content/uploads/2014/04/norway-mountain-river-images-photos-0321205905.jpg);
       background-size: 100%;
       background-position: center;
       background-repeat: no-repeat;
       background-attachment: scroll;
       margin: 0;
       padding: 0;
       font-family: Tahoma, Arial
     }

</style>

由Star Light于修改

more options

I checked, the problem with the image size.

I changed the image url and its worked fine, here for your reference


<style>

    body {

background-image:url(http://farm3.staticflickr.com/2509/4347593358_0f61b650bf_o.jpg);

      background-size: 100%;
      background-position: center;
      background-repeat: no-repeat;
      background-attachment: scroll;
      margin: 0;
      padding: 0;
      font-family: Tahoma, Arial
    }

</style>

more options

Oh, that's weird. You're right, right after I change the link it turn out working after few minutes. Thanks a lot :)

BTW, can I ask you once more question? It's about margin selector. Normally, if I put and "auto" value into "margin" it suppose to be center right? But in this code it won't (I never see this sintulation before)

<style>

     main {
       background: rgba(0,0,0,.4);
       position: absolute;
       margin: 20px auto;
       padding: 5px;
       width: 1000px
     }

</style>

more options

Welcome. You can ask "N" number of Questions.

Try with div. Even I can't figure it out the issue, but I'll get back to you ASAP. Sorry :(

more options

See http://dorward.me.uk/www/centre/

You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.

  • Hold down the Shift key and left-click the Reload button
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Command + Shift + R" (Mac)
more options

@iamjayakumars: Thanks :) I will try it.

@cor-el: I don't think problem at cache. :)

由Star Light于修改

more options

Could you try this Start Light

<style>

    main {
      background: rgba(0,0,0,.4);
    position: relative;
    display: block;
      margin: 20px auto;
      padding: 5px;
      width: 1000px
    }

</style>

more options

I had used your code and... It does working but... New problem has been appeared: https://www.facebook.com/photo.php?fbid=247657238751427

<main> tag should cover post (<article> tag) but it seem like... uhm, it isn't working as I expected. I also try change position for <article>, and here is problem: https://www.facebook.com/photo.php?fbid=247667368750414

I'm sorry for trouble you so much :'(