Visualforce align text to right of radio button - salesforce

I have some simple code to display a list as radiobuttons:
<apex:selectRadio value="{!q.option}" layout="pageDirection">
<apex:selectOptions value="{!q.options}"/>
</apex:selectRadio>
My problem is that the texts of the options are aligned below the radio buttons:
O
option1
O
option2
When what I need is:
O option1
O option2
I suspect CSS is the issue but I can't access it. Is there a way to overwrite that CSS to fix this? or any other option?
Thanks

In your VF page, just below the page tag, you can specify a style section and add a style class on your component just like in .NET. You can also have site wide CSS files, but I don't think that's what you are asking here.
<apex:page>
<style type="text/css">
.italicText { font-style: italic; }
</style>
<apex:outputText styleClass="italicText" value="This is kind of fancy."/>
</apex:page>
For more info: https://www.salesforce.com/docs/developer/pages/Content/pages_styling_custom.htm

Related

Angular Material can't set md-card as an anchor

Is it possible to make the whole card a link in Angular material or is there another directive intended for this use case?
You can just put a ng-click on the card and perform your operation.Further you can style the card with hover effects to get the feel of a link.Like this :
HTML:
<md-card ng-click="cardSelected()" class="cardAsLink">
....
</md-card>
JS:
$scope.cardSelected=function(){
console.log("card Clicked");
}
CSS:
.cardAsLink{
cursor: pointer;
}
.cardAsLink:hover{
border : 1px solid blue;
}
Yes you can put an anchor tag around the card. I think it is the better solution because you have the hole functionality of the anchor tag. In Ramblers answer clicking would work fine and if you use the the router the historie would also be korrect, but thinks like clicking with the mouse wheel to open a new tap would not work. The same goes for right mouse click thinks and the navigation preview on the bottom of the browser would also be missing.

XPages checkbox style

I would like to create checkBox with good formating. I used this as you can see in the picture but It doesn't look well. What is the best way to create checkbox to show more than 10 values in it?
https://www.openntf.org/main.nsf/project.xsp?r=project/Multi%20Column%20Controls/screenshots
It's just about css.
My guess is that you changed relevant css definitions for other parts of your application like this and they take effect on this checkbox table now.
Eliminate your css file for a test and look if it works then. If yes, adapt your css definitions so that it works for both cases.
I had the same issue in my application, as Knut already mentioned it is a css issues.
My solution
In a theme I have added the following code to style all checkboxes the same
<!-- Basic CheckBox -->
<control>
<name>CheckBox</name>
<property>
<name>styleClass</name>
<value>btn-checkbox</value>
</property>
</control>
And in the css I have added the following lines of code
.btn-checkbox label{
margin: 0px 10px 0px 0px;
font-weight:normal;
}
As you can see the problem was in the label of the checkbox.
You can go the theme route, to style all your checkboxes the same way or add it direct to the checkbox with styleClass="btn-checkbox"

How <style>...</style> is linked/works in angular material design (links provided)?

Please look at this.
When you right click the words "Basic usage"(seen at top of the page, first block), you can see below html:
<md-toolbar class="demo-toolbar md-primary">
<div class="md-toolbar-tools">
<h3 class="ng-binding">Basic Usage</h3>
<!-- ...other html -->
And when you select "md-toolbar" from above code in elements panel, it will show that it has background color of some blue. And it shows style source as
<style>...</style>.
When you click it, will show it like(click and see please). But generally, it either gives filename.css or says index if css is embedded in html file. But this seems different.
So, my question is there anything "angular/material" with it. Whats going on here ?
From Theme/Under The Hood docs
Each registered theme results in 16 <style> tags being generated.
It's their way of translating the $mdThemingProvider config from javascript to css

How can I make text that looks like a link run a controller function when clicked?

I have a simple link that a user clicks on when they need to get a password reminder:
<a ng-click="forgotPassword()">Forgot your password?</a>
I tried this but it does not seem to work. I would like the functionality of a link, the look of a link (with an underline appearing on hover) but do not want to have the /# appear in the bottom of the browser when I hover.
Can anyone suggest some ways that I could achieve this with AngularJS?
Use a <span class="link" ng-click="forgotPassword()"> tag. Style it with text-decoration: underline; cursor: pointer;, the color you like, etc.

How to show popover that is hiding behind navbar

I am new to Bootstrap and Angular. In my webpage there is a button and i am providing a popover for a span like this
<span popover="Download Project History" popover-trigger="mouseenter" tooltip-placement="top" style="padding: 5px" translate="DOWNLOAD">DOWNLOAD</span>
But its getting hidden under navbar.
Based on my googling i found to provide data-container="body" in the html element. But its not working too.
Can anyone please help me?
Thanks
I had a similar problem where the popover was hidden behind overflow content and adding the following attribute fixed it:
popover-append-to-body="true"
tooltip-append-to-body="true"
attaches the tooltip to the body and makes it visible.
You need to override the z-index value, you can have a look for the default values (for navbar and popover) in original Bootstrap's CSS file. In my case this helped:
.popover {
/* just in case it would overlap with fixed navbar, then show this over the navbar. Original value 1010, value for navbar is 1030 */
z-index: 1030;
}

Resources