IP.Board Tutorials

[IPB 4Add a background image to the header

Submitted by Admin, , Thread ID: 6906

Thread Closed
Admin
Novice
Level:
0
Reputation:
3
Posts:
41
Likes:
3
Credits:
5
11-07-2015, 06:46 AM
#1
This tutorial will teach you how to add a background image to the header in the default IPS 4.x.x theme, as shown below.

BEFORE:

[Image: 3ziOPt6.jpg]

AFTER:

[Image: BPWEhuq.jpg]

1. To begin, log into your ACP and browse to Customization > Themes. Click the arrow to the right of your theme and select Manage Resources. Click the + Add Resource button at the top right.


2. Change the location from admin to global and use the Choose single file... button to upload your background image. This tutorial uses header.jpg as the file name, however you are welcome to use whatever name you like. Press Save.

[Image: OqNIcox.jpg]

3. You will be taken back to the resources page. Use the Search: Name field at the top right to search for your file name (header.jpg). Under the Template tag column, you'll see your resource code which allows you to reference that image in your css and HTML. We'll need this code in the next step:

Code:
{resource="header.jpg" app="core" location="global"}

4. Go to Customization > Themes > Edit HTML and CSS. Click the CSS tab and choose custom.css. Paste the following code:


Code:
@media screen and (min-width:980px){

  #ipsLayout_header header{
   background-image: url('{resource="header.jpg" app="core" location="global"}');
   background-size: cover;
   background-position: 50% 0%;
   background-repeat: no-repeat;
  }

  #elSearchNavContainer{ background: rgba(0,0,0,0.5); }

}

The first line, starting with @media restricts the css to desktops and laptops. The background image will not be shown for tablets or mobiles (which is ideal for loading times). If you wish to show the image on all devices, remove the top line, and the } in the very last line.

background-image simply defines our image URL, using the template tag from step 3.
background-size defines if the image should be stretched to occupy the entire space of the header. Remove this line if you don't want the image to use it's natural image size
background-position defines the position of the image (centered horiztontally, positioned at the top vertically).
background-repeat defines how the image should be repeated (no-repeat, repeat, repeat-x, repeat-y)

For an added effect, the background of the navigation bar has been changed to a semi-transparent black, which allows your background image to show beneath it. You are welcome to remove that code if you wish since it may not look correct for all images.

Done!

RE: [IPB 4Add a background image to the header

witter
Closed Account
Level:
0
Reputation:
0
Posts:
26
Likes:
0
Credits:
0
19-09-2015, 06:05 PM
#2
tested this workin fine demo

http://greekbytez.com/bytez/

RE: [IPB 4Add a background image to the header

MobiMyle
Junior Member
Level:
0
Reputation:
0
Posts:
52
Likes:
5
Credits:
49
19-09-2015, 06:50 PM
#3
Hey, Good tut mate. Thanks for sharing.
Quote:I am not special, I am just anonymous.
I am here to learn, anybody who is willing to teach, always consider me in.

RE: [IPB 4Add a background image to the header

jacdem
Novice
Prime
Level:
0
Reputation:
0
Posts:
24
Likes:
1
Credits:
0
12-11-2015, 04:56 PM
#4
A screenshot would be nice!

RE: [IPB 4Add a background image to the header

bxhdwh
Novice
Level:
0
Reputation:
0
Posts:
33
Likes:
5
Credits:
172
12-11-2015, 05:33 PM
#5
Thank you for tutorial!

RE: [IPB 4Add a background image to the header

emreyldz
Novice
Level:
0
Reputation:
0
Posts:
28
Likes:
1
Credits:
18
10-12-2015, 07:30 PM
#6
thanks you man! ^^

RE: [IPB 4Add a background image to the header

MosLaDatorie
Novice
Level:
0
Reputation:
0
Posts:
24
Likes:
1
Credits:
26
12-12-2015, 08:33 AM
#7
Thanks for tutorial, i need it

RE: [IPB 4Add a background image to the header

skins20
Novice
Level:
0
Reputation:
0
Posts:
35
Likes:
1
Credits:
3
14-12-2015, 07:31 PM
#8
Thanks for sharing
good this

RE: [IPB 4Add a background image to the header

Relik
Novice
Level:
0
Reputation:
0
Posts:
20
Likes:
1
Credits:
6
31-05-2018, 10:16 PM
#9
Unfortunately on version 4.3.3 it does not work, or at least I can not run it.
Is there another way to insert a background image on 4.3.3?
Thank you in advance.

RE: [IPB 4Add a background image to the header

25-06-2018, 12:35 AM
#10
31-05-2018, 10:16 PM
Relik Wrote:
Unfortunately on version 4.3.3 it does not work, or at least I can not run it.
Is there another way to insert a background image on 4.3.3?
Thank you in advance.

same problem..

Users browsing this thread: 1 Guest(s)