Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Custom CSS to make something like the 'Hot' and 'New'

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi,

I trying to make a version af the 'HOT' badge that will display the word 'Annonce' (that means ad).

I only want to show the badge - not the title of the module. Please see the attached image.

I am not that skilled with CSS, so can someone here help me?

Thanks,
Bjarne :)
Attachments:
  • Bjarne Søby's Avatar
  • Bjarne Søby
  • 12 Month basic
  • 6 posts
  • Karma: 0
The administrator has disabled public write access.
Hi

How far are you with this?

Do you have a link

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi,

I managed to change the word 'HOT' to 'Annonce', but I can not find a way to hide the module title and still show the badge.

www.altomcamping.dk/nyt_site/

Thanks,
Bjarne
  • Bjarne Søby's Avatar
  • Bjarne Søby
  • 12 Month basic
  • 6 posts
  • Karma: 0
The administrator has disabled public write access.
On your site I can't find a page with a sidebar so this is from a local site on my machine

.annouce .module-inner:before {
position: absolute;
z-index: 20;
padding: 0px 4px;
font-size: 10px;
top: 15px;
right: 0px;
font-style: italic;
background: #333;
color: #fff;
line-height: 1.4;
}

.annouce .module-inner:before {
content: "Announce";
background: #0092b2;
}
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
You could merge those styles but thought it would be easier for you to see what is happening
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
You will also need to add a module class to the module in the case above I added annouce

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thanks Paul, I really appreciate your help.

The CSS code almost did the job, but the badge is placed on the far right side of the screen and not at right site of the module. Can you telle me how to fix this?

www.altomcamping.dk/nyt_site/

Cheers,
Bjarne
Attachments:
  • Bjarne Søby's Avatar
  • Bjarne Søby
  • 12 Month basic
  • 6 posts
  • Karma: 0
The administrator has disabled public write access.
ah I was only working with sidebars on this
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
sidebar1.png
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
I think you could knock off the right position but if you are adding several modules in a row this won't work either
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
The following user(s) said Thank You: Bjarne Søby
Hi Paul,

Thanks for your help. It pushed me in the right direction. I came up with this, and it is working :)

Take care....


Cheers,
Bjarne

.advert,.nyt{position: relative;z-index: 1}

.advert h6,.nyt h6{visibility: hidden;}

.advert h6:after,.nyt h6:after,.advert h6:after,.nyt h3:after{position: absolute;z-index: 20;padding: 0px 0px;font-size: 10px;top: 20px;right: 20px;font-style: italic;background: #333;color: #fff;line-height: 1.4}

.sidebar .advert h6:after,.sidebar .nyt h6:after,.sidebar .advert h6:after,.sidebar .nyt h6:after{top: -10px}


.advert h6:after{content: "Annonce";background: #004080;visibility: visible;display: block}

.nyt h6:after{content: "OBS";background: #2c3e50;visibility: visible;display: block}}
  • Bjarne Søby's Avatar
  • Bjarne Søby
  • 12 Month basic
  • 6 posts
  • Karma: 0
The administrator has disabled public write access.
No worries

Thanks for posting your solution :)
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
have just noticed you have an extra close bracket on the code snippet you added - just thought I'd mention it

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers