no access to html - trying to style some text bigger - css

I'm using a CMS to try and alter a fundraising form so the text is bigger.
I've managed to alter the paragraph and <h> easily enough but there are some stubborn labels that i cant get to go bigger - here is one - I'd like the words "Payment Frequency" to be 20px or so....
<div class="field select required">
<label for="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_DropDownList" id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_LabelForDropDownList">***Payment Frequency***</label>
<select name="ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder234$FormControl1$DonationSection$DropDownPaymentFrequency$DropDownList" id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_DropDownList">
<option value="">Please Select...</option>
<option selected="selected" value="Monthly">Monthly</option>
<option value="Annually">Annually</option>
</select>
</div>
I have been able to style these individually but there must be a better way, there are loads of them, here is another example:
<div class="field text date required">
<label for="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_CollectionDate_DropDownListDay" id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_CollectionDate_LabelTextBoxCollectionDate">Collection date </label>
I tried styling all "labels" but only the first one changed. the rest stayed the same.

There could be another CSS rule which is overwriting your new CSS rule. You can use the !important to overwrite an already existing CSS rule. See the following:
div.field label {
font-size:20px !important;
}
<div class="field select required">
<label for="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_DropDownList" id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_LabelForDropDownList">***Payment Frequency***</label>
<select name="ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder234$FormControl1$DonationSection$DropDownPaymentFrequency$DropDownList" id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder234_FormControl1_DonationSection_DropDownPaymentFrequency_DropDownList">
<option value="">Please Select...</option>
<option selected="selected" value="Monthly">Monthly</option>
<option value="Annually">Annually</option>
</select>
</div>
Hint: Make sure your CSS rules are included after the CSS files of Frameworks (like Bootstrap or Foundation). This way or using a selector with a higher specificity. These ways should be tried before using !important because using !important is not recommended.

Related

In Bootstrap4 input-group helptext does not display as block

I have a page that uses Bootstrap 4 with a single input control that was working okay. My problem is when I add help it adds it on the same line rather than the next line beneath the control as I would expect.
My suspicion is it that it is a problem with input-group/form-group. Im finding the generally very good Bootstrap documenentation very unclear on how these two things fit together since Im using inputgroups as the field label.
This is the html
<div class="input-group">
<div class="input-group-prepend">
<label for="undoLocation" id="undoLocationlabel" class="input-group-text">
Find songs
</label>
</div>
<select class="custom-select" name="undoLocation" id="undoLocation" aria-describedby="undoLocationHELP">
<option value="0">
that are currently in the selected locations
</option>
<option selected="selected" value="1">
that were originally in the selected locations
</option>
</select>
<small id="undoLocationHELP" class="form-text text-muted">
When files have been moved by SongKong you can use this option to find files currently in the selected all location or find files that were originally in the selected location
</small>
</div>
and I have created a jsfiddle.
https://jsfiddle.net/paultaylor/g64v96fy/1/
According to Bootstrap discussion:
Block help text—for below inputs or for longer lines of help text—can be easily achieved with .form-text. This class includes display: block and adds some top margin for easy spacing from the inputs above.
However, you added it to a parent element with a input-group class, by nature will display with the group, inline. Additionally, you used an HTML default inline tag <small> which also displays, by nature, inline.
Per specs:
The small element should not be used for extended spans of text, such as multiple paragraphs, lists, or sections of text. It is only intended for short runs of text...
Even if you do what's recommended and wrap it in a <p> tag, the parent still defines the style, and input-groups by nature are inline.
So, it's recommended to move it outside of the div.
<div class="input-group">
<div class="input-group-prepend">
<label for="undoLocation" id="undoLocationlabel" class="input-group-text">
Find songs
</label>
</div>
<select class="custom-select" name="undoLocation" id="undoLocation" aria-describedby="undoLocationHELP">
<option value="0">that are currently in the selected locations</option>
<option selected="selected" value="1">that were originally in the selected locations</option>
</select>
</div>
<p id="undoLocationHELP" class="form-text text-muted">
When files have been moved by SongKong you can use this option to find files currently in the selected all location or find files that were originally in the selected location
</p>

Angular 2- images inside select drop down is always 0X0 pixels. Image loaded but not displayed in chrome

A select drop down in my angular 2 app doesn't show my images associated to options, though the images are working when I isolate from select drop down. Some CSS is overwriting my images in select - I can load image but can't display it. Here's my code:
<form>
<select [(ngModel)]="ddselectedStatus" name="statusselect" style="width:320px;" (ngModelChange)="onStatusChange($event)" class="col-xs-8 form-control">
<option value="">--Select Status--</option>
<option [ngValue]="i" *ngFor="let i of myOptions">
<img src="images/opened.png" class="rowindic"/>
{{i.name}}
</option>
</select>
</form>
its just a matter of CSS. This should help but keep in mind other CSS may also interrupt,
<img [style.width.px]="50" [style.height.px]="50"
[src]="images/opened.png" class="rowindic" />

CSS - Placing content of a child element in the parent

I'm trying to create a print stylesheet for a web form that users fill out by hand and then copy to the web version. Unfortunately, I can't figure out how to print my select list options. It only prints whichever option is currently selected.
Is it possible with CSS (JavaScript isn't an option) to extract the content from the select options and place them in a parent element? I'm thinking something like this:
HTML:
<div id="parentDiv">
<select>
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
</select>
</div>
and CSS:
#media print{
#parentDiv:before {
content: child.attr(value);
}
}
That's obviously not correct, but is there a way to actually do this? Or any other JavaScript-free way to print out the options?
NOTE: The page is dynamically rendered, and I am not able to render additional "hidden" <div> elements to unhide in the print css, so that solution won't work for me.
THANKS!

Determine if a Select element is dropped-down - using only CSS or SASS

Only using CSS, is there a way to determine if a select box is dropped down or closed?
I know that there are pseudo classes such as :checked and :indeterminate, but I haven't seen one that will work in conjunction with the select element the way I want.
Here's an example of my select box - with an id of "field-action" :
<select id="field-action" name="" class=" " data-validation-required="true">
<option value="" selected="selected">—</option>
<option value="1" id="field-action-lock">Lock</option>
<option value="2" id="field-action-unlock">Unlock</option>
<option value="3" id="field-action-pin">Pin</option>
<option value="4" id="field-action-unpin">Unpin</option>
<option value="5" id="field-action-delete">Delete</option>
<option value="6" id="field-action-undelete">Undelete</option>
<option value="7" id="field-action-move">Move</option>
<option value="8" id="field-action-merge">Merge</option>
<option value="9" id="field-action-spam">Spam</option>
<option value="10" id="field-action-notspam">Not Spam</option>
</select>
The goal - using pure CSS or SASS - is to determine if the select list is dropped down, and if so, give it a bottom margin of about 50px. When the box is dropped, it overlays some content that cannot be covered under any circumstances.
Any input is appreciated - thanks!
SELECT elements are not rendered using HTML, they are part of the browser/operating system. When opened they do not take up any space within the DOM, therefore CSS cannot detect this.
Although this appears to be the only way to manipulate the select box via CSS, it is not acceptable as tabbing into the select box triggers the focus but does open the select box. The user must click to open it.
Why not :focus?
select:focus {
}
Fiddle: http://jsfiddle.net/ewqSA/
There might be an alternative way of showing your options. Instead of a drop down list, you could use a select list like is in this jsfiddle http://jsfiddle.net/cSSjF/ linked in this answer https://stackoverflow.com/a/8788381/1804496
<select size="5">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
This still allows only one option to be selected, and lets you control how many options you want to be visible. I'm assuming you could show just enough options that your important content isn't pushed off the viewable area.

ASP.NET: How to enter a Tab character in entry of listbox?

I have a dropdown list box which has a few itens as coded below in an aspx file:
<asp:ListItem Value="1"> Chairs</asp:ListItem>
As you can see, I tried to put a few blank characters before the word Chairs BUT they are removed when Chairs is displayed in the dropdown list box.
How do I force the indentation of Chairs with spaces or with a tab character in a aspx file? \t for TAB doesn't work. Thanks.
<asp:ListItem Value="1"> Chairs</asp:ListItem>
Try the for the spaces which is the html representation of a space.
How about adding CSS styles to indent the text? You can set the text-indent: 10px CSS style on the <option> tag. Mind you, it won't work in IE, which sucks pretty bad.
Also don't forget the <optgroup> tag, which you can use to group elements in a dropdown. It's a very overlooked tag, probably because the ASP.NET list and dropdown controls doesn't support it.
Try this in your page, and see what happens:
<select>
<optgroup label="Group 1">
<option value="1">Item 1</option>
<option value="2">Item 2</option>
</optgroup>
<optgroup label="Group X">
<option value="1">Item A</option>
<option value="2">Item B</option>
</optgroup>
</select>
:)

Resources