• Hi, I’d like to have the ability to rather easily add a photo to a page or post content area as a background image where I can add text over it. I haven’t been able to find the solution or plugin for this. Any suggestions? Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Background images can be added to a specific element (area) on a page — it’s done using CSS.

    https://www.w3schools.com/css/css_background.asp

    Thread Starter IndianaGirl

    (@arizona-girl)

    So to achieve having an image in the content area only (on one page or post), and text that can appear over it, it looks like I would use the following code. Does it go in the text editor html area, or maybe somewhere else?

    body
    {
    background-image:url(‘https://www.mysite.com//wp-content/uploads/2012/10/image-name.jpg’);’);
    background-repeat:no-repeat;
    background-attachment:fixed;
    }
    </style>
    </head>

    <body>
    <p>The text goes here.</p>
    </body>

    Kinda right. The CSS code goes in the style.css file (or custom.css file if you have one). (Technically it could go in the head of the page, but that’s less ideal and more complicated to do with WP.) But you need to use a CSS selector for the element where you want the image to be the background of — if you use body — it will be behind the entire page. Is that what you want? If you want it to only be behind the content section — use the id or class for that element (maybe “content” but that depends on your theme).

    And then, yes, the text goes in the usual place — inside the element you put the background in.

    If you need more specific help, it will be a lot easier if you can post a link to your site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image in post or page area (not background)’ is closed to new replies.