Support » Localhost Installs » I can not put images

  • Resolved dfart

    (@dfart)



    I am setting up a web page and when I try to put images between the menu and the content of the page, I do not load the image and that space appears blank.

    To put the images I am putting them in the file style.css in a line that points to the ID of the page and below it has background-image and the link of the image.

    Could you tell me the reason why the image does not appear?

    A line example is the following:

    .page-id-45 #imagencentralpagina{
    
    background-image: url("../../uploads/cabecera_222.jpg");}

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @dfart,
    you will need to provide some context to your questions. What theme are you using? What’s your site’s address (if it’s online)?

    @alichani I´m sorry.

    I’m using a theme that was made from scratch for the other website, so I could not say the name and my page is not online yet, so I can not say the website either.

    I have managed to put the images, I had a badly configured style.

    Now, I ask them if they could tell me some code to add to the CSS to indicate that the images fit the width of the page since they are left in the middle.

    Thanks for your help.

    The background image is requested by the browser, at this stage there is no “state” or “context” for the requested file, hence there is no concept that the current directory is the theme directory in which the style.css file is found. All websites and web browsers work this way, hence relative directory references do not work, your CSS snippet should be:

    .page-id-45 #imagencentralpagina{
    background-image: url("/wp-content/uploads/cabecera_222.jpg");}

    You can set the size of images if required, details on this and all things CSS (+html etc) here:
    https://www.w3schools.com/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I can not put images’ is closed to new replies.