Buy Now
Sign in

How to add a CSS class to a page component

NickOg , November 08 2020, 06:00
NickOg 925
November 08 2020, 06:00 #394750
Hi
I want to add a CSS class to areas or fields and the like. How do I do that? I can't find the CF6 'class' options in CF7.
Regards
Nick
D
different_greyhead 99
November 08 2020, 06:58 #394754
Hi Nick,
Try from inside views as below:
CF44.PNG
Attachments
CF44.PNG
CF44.PNG
(10.78 KiB)
121 Downloads/Views
NickOg 925
November 08 2020, 10:27 #394755
hi
but that would only add my CSS definitions to the form would it not? How do I add a reference to those definitions into a control?
Nick
NickOg 925
November 08 2020, 19:16 #394760
 Answer
I have found the answer to this.
To include a class reference in a control, add an HTML Tag Attribute named 'class'.addClass.png
Attachments
addClass.png
addClass.png
(18.83 KiB)
117 Downloads/Views
J
JPBleau 4
December 29 2020, 16:07 #395529
How can we change the icon attribute? using the add custom puts the class in the input and the icon is under input, not inside...
What I want to do is to replace the icon with an image. Or can we put images inside the label ?
NickOg 925
December 29 2020, 20:02 #395533
I am not quite sure that I understand the question. There is the icon attribute on label in some areas such as 'message'
icon.jpg
Or, if that is not it, you could perhaps add an image using css but I have never tried that.
 div.clsBookingRepeater span.clsCourseID::before{
content: 'Course #';
}
Attachments
icon.jpg
icon.jpg
(57.59 KiB)
62 Downloads/Views
J
JPBleau 4
December 29 2020, 20:17 #395534
I did put an icon, but chose None. It creates a <i> tag under the input. Using CSS, it is possible to put an image in there, but the class is not changeable in the <i> tag. That would be nice....
admin 32
January 03 2021, 00:12 #395558
where exactly do you want to place an image ?
if you do not like the icons in the menu then you can write your icon's name, the whole list is available on the font-awesome website here:
NickOg 925
January 03 2021, 00:14 #395559
Now that is very useful Max
Thanks
Nick