XF 2.1 Make ads look like the other containers

Jens1986

Active member
Hi,

Is there an easy way to make the ads look like the rest of the containers on the forum? So that it has rounded corners, has the same width etc?

This is what it looks like today:

1563440122793.webp

This is how I would like it to look:
1563440231174.webp

Any ideas?
 
You can use a border radius (4px is pretty standard around XenForo) with a background color and padding to make it blend in a little more. See code below:

HTML:
<div style="border-radius:4px; background-color:#ffffff; padding:10px;">
  YOUR AD CODE HERE
<div>

Adjust above as necessary to get the look you want. As for matching width of surrounding elements that will be nearly impossible. Most sites and ads now are responsive. Meaning, depending on screen size, the ad displayed will also change in size (height and width).
 
You can use a border radius (4px is pretty standard around XenForo) with a background color and padding to make it blend in a little more. See code below:

HTML:
<div style="border-radius:4px; background-color:#ffffff; padding:10px;">
  YOUR AD CODE HERE
<div>

Adjust above as necessary to get the look you want. As for matching width of surrounding elements that will be nearly impossible. Most sites and ads now are responsive. Meaning, depending on screen size, the ad displayed will also change in size (height and width).

Thank you so much! That helped a lot!

Do you know how to get the standard border like the rest of the boxes? Or how to make it full width at a low resolution?
 
This will add the border:

Code:
<div style="border-radius:4px; background-color:#ffffff; padding:10px;border: 1px solid #d8d8d8">
  YOUR AD CODE HERE
<div>


Not sure I know what you are asking about width.
 
Back
Top Bottom