背景图像:网址("图像/ plaid.jpg")不重复;不会出现 [英] background-image: url("images/plaid.jpg") no-repeat; wont show up

查看:189
本文介绍了背景图像:网址("图像/ plaid.jpg")不重复;不会出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法让我的plaid.jpg任何我的网页背景,更不用说所有的人,我一直试图通过身体,HTML,*,家的具体ID选择它。没有什么作品。该图像是300×421像素。我并不需要它展现出来pretty,我只是希望它的出现,一切都落后。如何将我的CSS寻找这个?该plaid.jpg图片是在我的图片在同一目录作为我的index.html文件夹中。此链接是我的index.html文件的顶部。我的样式表是我在样式表文件夹命名为mystyles.css。

 <链接rel =stylesheet属性类型=文/ CSS的href =样式表/ mystyles.css>

我试图改变我的.css文件各种方式在我看来,简直不可想象。前30谷歌搜索结果背景图片显示不出来,并没有奏效。我知道这可能是简单的东西。

mystyles.css在其最基本的形式,没有选择

 背景图像:网址(图像/ plaid.jpg)不重复;

index.html的

 <身体GT;
        !< - 位置:首页 - >
            < D​​IV ID =家
                数据角色=页面
                数据标题=家>
                < D​​IV数据角色=头
                    数据位=固定
                    数据主题=B>
                    < H1>家庭和LT; / H1>
                    &所述; A HREF =#信息
                        数据图标=信息
                        数据iconpos =NOTEXT
                        数据相对=对话
                        类=UI-BTN-权
                        >信息与LT; / A>
                < / DIV><! - 标题 - >
                < D​​IV数据角色=内容>                < D​​IV数据角色=controlgroup数据主题=E>
                    < A HREF =#博客
                        数据角色=按钮
                        数据图标=箭头-R
                         数据主题=E
                    >博客< / A>
                    < A HREF =#视频
                        数据角色=按钮
                        数据图标=箭头-R
                         数据主题=E
                    >视频及LT; / A>
                    < A HREF =#照片
                        数据角色=按钮
                        数据图标=箭头-R
                         数据主题=E
                    >图片< / A>
                    < A HREF =#微博
                        数据角色=按钮
                        数据图标=箭头-R
                         数据主题=E
                    >&鸣叫LT; / A>
                < / DIV><! - 链接 - >
                < / DIV> <! - 内容 - >
            < / DIV><! - 网页 - >

这不是成功的。

  {体
    背景图像:网址(/图片/ plaid.jpg);
    背景重复:不重复;
}

这是什么,我也

 < HEAD>
    <间的charset =UTF-8/>
    <标题>暴民应用< /标题>
    < HEAD>
    < META NAME =视口CONTENT =WIDTH =设备宽度,初始规模= 1,最大规模= 1/>    <链接rel =快捷方式图标的href =图片/的favicon.ico/>    !< - <链接rel =stylesheet属性HREF =HTTP://$c$c.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css/> - >
    &所述; SCRIPT SRC =HTTP://$c$c.jquery.com/jquery-1.8.2.min.js>&下; /脚本>
    &所述; SCRIPT SRC =HTTP://$c$c.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js>&下; /脚本>    <脚本SRC =JavaScript脚本/ myscript.js>< / SCRIPT>
    <链接rel =stylesheet属性类型=文/ CSS的href =样式表/ mystyles.css/>
    < /头>


解决方案

您要么使用:

 背景图像:网址(图像/ plaid.jpg);
背景重复:不重复;

...或

 背景:透明的网址(图像/ plaid.jpg)左上方不重复;

...但确切的不可以

 背景图像:网址(图像/ plaid.jpg)不重复;

修改:在演示的 的jsfiddle 使用绝对路径(如果您有烦恼指的是相对路径图像)。

I can't seem to make my plaid.jpg the background on any of my pages, let alone all of them, I've tried selecting it by body, html, *, the specific id of "home". nothing works. The image is 300 x 421 pixels. I don't need it to show up pretty, i just want it to show up, behind everything. how would my css look for this? the plaid.jpg picture is in my images folder in the same directory as my index.html file. This link is at the top of my index.html file. and my stylesheet is in my stylesheets folder named mystyles.css.

<link rel="stylesheet" type="text/css" href="stylesheets/mystyles.css">

I have tried altering my .CSS file every way imaginable in my opinion. the first 30 google results for "background-image not showing up" and none worked. I'm aware it's probably something simple.

mystyles.css in its most basic form with no selector.

  background-image: url("images/plaid.jpg") no-repeat;

index.html

 <body>
        <!-- Page: home -->
            <div id="home"
                data-role="page"
                data-title="Home">
                <div data-role="header"
                    data-position="fixed"
                    data-theme="b">
                    <h1>Home</h1>
                    <a href="#info"
                        data-icon="info"
                        data-iconpos="notext"
                        data-rel="dialog"
                        class="ui-btn-right"
                        >Info</a>
                </div><!-- header -->
                <div data-role="content">

                <div data-role="controlgroup" data-theme="e">
                    <a href="#blog" 
                        data-role="button"
                        data-icon="arrow-r"
                         data-theme="e"
                    >Blog</a>
                    <a href="#videos" 
                        data-role="button"
                        data-icon="arrow-r"
                         data-theme="e"
                    >Videos</a>
                    <a href="#photos" 
                        data-role="button"
                        data-icon="arrow-r"
                         data-theme="e"
                    >Photos</a>
                    <a href="#tweets" 
                        data-role="button"
                        data-icon="arrow-r"
                         data-theme="e"
                    >Tweets</a>
                </div><!-- links -->
                </div> <!-- content -->
            </div><!-- page -->

this wasn't succesful

body {
    background-image: url("/images/plaid.jpg");
    background-repeat: no-repeat;
}

this is whats in my also

<head>
    <meta charset="utf-8" />
    <title>Mob App</title>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

    <link rel="shortcut icon" href="images/favicon.ico" /> 

    <!--<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />-->
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

    <script src="javascripts/myscript.js"></script>
    <link rel="stylesheet" type="text/css" href="stylesheets/mystyles.css" />
    </head>

解决方案

You either use :

background-image: url("images/plaid.jpg");
background-repeat: no-repeat;

... or

background: transparent url("images/plaid.jpg") top left no-repeat;

... but definitively not

background-image: url("images/plaid.jpg") no-repeat;

EDIT : Demo at JSFIDDLE using absolute paths (in case you have troubles referring to your images with relative paths).

这篇关于背景图像:网址(&QUOT;图像/ plaid.jpg&QUOT;)不重复;不会出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆