0
votes
.jumbotron {
    margin-bottom: 0px;
    background-image: url(../img/desktop-urania.jpg);
    min-height: 600px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

This is the working CSS in HTML, but i am trying to convert HTML to WordPress, while converting I link my stylesheet in function.php (function urania_script_enqueue() { wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/urania.css', array( '$handle', '$src', '$deps', '$ver', '$media'), '1.0.0', 'all');)

but image is not loading ...

Theme Name URANIA:: -> Css-> urania.css (Stylesheet) Theme Name URANIA:: -> img -> desktop-urania.jpg (image)

Please Help

2
CSS file is loading correctly, but image is not?Turi S.
image is not printing ...Ashish Lala
.jumbotron { margin-bottom: 0px; background-image: url(../img/desktop-urania.jpg); } i tried with this also but still imageis not printing..Ashish Lala
jumbotron is printing but how to add a background image ?Ashish Lala
There's not much to go off of, any way you can provide a link? Have you tried checking the console for errors?Turi S.

2 Answers

0
votes

Please check your image color mode if your image color mode is CMYK then it will not display on IE-8 you need to change the color mode to RGB.

If your image color mode is correct then It would be better if you can share the actual site URL so that we can see the structure of site properly.

0
votes

PHP will not work in a css file, but you could use a wordpress function inline. You can use just css. Since my css (after sass processing) ended up in one file in the theme root, I had to alter my file path.

The following stackoverflow answer solved my problem. CSS background images in WordPress

Try double checking your file path or follow wp convention and put the css in styles.css in the root. See get_template_directory_uri(). Also perhaps wordpress likes the path in quoatation marks?

.jumbotron {background-image: url("images/desktop-urania.jpg")}