Skip to Content Skip to Menu

Assign css to filed

  • komir
  • komir
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
7 years 9 months ago #288392 by komir
Assign css to filed was created by komir
Hi all. First of all this is my first contact with CB and have beginner question.
In demo
demo.cbdemosites.com/profiles/andrea
have field what is generated by code
Code:
<div id="cbfr_45" class="sectiontableentry1 cbft_formatname form-group cb_form_line clearfix"> <label id="cblabcbfv_45" class="control-label col-sm-3" for="cbfv_45">Formatted Name</label> <div class="cb_field col-sm-9"> <div id="cbfv_45">Andrea F.</div> </div> </div>
Is it possible to assign background only to text
Code:
Formatted Name
to class="control-label col-sm-3" for="cbfv_45")?
Thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48314
  • Thanks: 8253
  • Karma: 1443
7 years 9 months ago #288427 by krileon
Replied by krileon on topic Assign css to filed
Add a CSS Class to the field by editing it in CB > Field Management then use that as your selector in your CSS. Example as follows.

CSS Class: myCssClassTest
Code:
.myCssClassTest .control-label { background-color: orange; }

Each label also has a unique ID attached that can be used for CSS. Example as follows.

Code:
#cblabcbfv_45 { background-color: orange; }

See the below for CSS learning resources.

www.w3schools.com/css/default.asp
developer.mozilla.org/en-US/docs/Learn/CSS


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum