This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Adjusting form CSS for JavaScript embeds
Started 11 years ago by MattShepherd | 4 posts |
-
Apologies, I'm not a great Web designer in the first place, so this is a pretty basic question.
If I want to adjust the CSS for a form when I'm using the JavaScript code to embed it on a page, where is that done from? Can I insert a link to my own style.css file in the HTML form where the page is embedded, or does the JavaScript code "override" that style somehow?
Posted 11 years ago # -
Or, I'll put it another way: I want all the text in my form to be blue, big, and in a serif font. So I use "Inspect Element" in Chrome to find the ID for the whole form -- form_container seems to be the containing DIV.
So I point the HTML page where the form is embedded at my CSS script, and I set
#form_container {
color:blue;
font-family: Times, serif;
font-size: 1.5em;
}Save the CSS, reload the page: no joy.
Okay, let me try something REALLY SPECIFIC. Find an element like the "Street Address" field:
#li_2_span_1
That's pretty specific!
#li_2_span_1 {
color:blue;
font-family: Times, serif;
font-size: 1.5em;
}Save, reload: still nothing.
What do I do to change the look of an embedded JS form? How do I "override" the CSS that seems to be carried over in the paste?
Posted 11 years ago # -
Someone else experienced a similar problem a while back. You may need to add !important in your CSS file as shown below.
#li_8 { background-color: #00FF00 !important; color: red !important; }
Check out this post http://www.appnitro.com/forums/topic/css-help-please?replies=9 for additional information.
Posted 11 years ago # -
Aha! Thanks, Steve -- I swear I searched the forum for "CSS" a few times and didn't find that thread. Maybe the "Css" with the "ss" in lower case was bugging the search somehow.
I've been given to understand that "!important" is kind of sub-optimal in terms of good practice, but if it works, I'll take it!
Posted 11 years ago #
Reply
You must log in to post.