How to style Popover Twitter Bootstrap - twitter

I have 4-5 different popovers . How to set own styles for each popover. If Each Popover has different width? Is it possible ?
All of popovers have the class .popover when I set for example width: 200px. All of them become 200px .I am not sure how to give them different width or height any ideas please

You can achieve customisation of popovers by adding an additional class to the elements you want styled differently, e.g.:
<div class="popover">
Normal popover
</div>
<div class="popover popover-wide">
Wide popover
</div>
<div class="popover popover-extra-wide">
This is a very wide popover
</div>
Then you can create CSS styles which provide those attributes. It's worth spending some time looking at CSS specificity, so you have a good understanding of which CSS rules will win-out.
The rules we want for this example are to only be applied when popover AND popover-wide are present, which we achieve by joining them with a .:
.popover.popover-wide {
width: 250px;
}
.popover.popover-extra-wide {
width: 400px;
}
You could achieve the same effect using IDs, but it's better form to use classes because they're reusable (id attributes need to be unique in the document). It's also good form to choose useful names for the classes which describe what they're used for, so you might choose to call them popover-intrusive or popover-subtle, but that's nice and subjective :)

Related

Set display of section tags to flex or grid

With Reveal.js, I would like to use flexbox and/or grids to layout slides. Unfortunately, it seems Reveal.js always overrides the display property of section tags with block as part of its slide show/hide logic. Viz:
<section class="mylayout">
<div>...</div>
<div>...</div>
</section>
section.mylayout {
display: flex;
}
Has no effect, because Reveal.js adds a style="display: block" attribute to the section tag.
Is there any way around this? It works to put a nested div inside the section and have that be grid/flex, but it just feels clunky and gross to have an extra layer in there that adds no other value than a workaround.
Has anyone else found a different way to address it?
You can set it to use flexbox in the initialization settings now. See this update on the documentation.

angularjs ui-grid: how to display all records taking more than one html page

Im using angularjs grid: this component allaways displays only data which fits to page. Suppose I want to have all data displayed at once, even if it takes a few pages (page scrolling is needed to see all data, but without grid scroll).
How to do it?
I played with:
parameter ui.grid.autoResize
trying to overwrite default css
setting.
No result.
Did you tried adding a class to your div. I can see the grid scroll bars if I add a CSS like so. You need to change the below CSS according to your needs.
.grid {
width: 580px;
height: 500px;
}
And here is my ui-grid
<div>
<div class="grid" ui-grid="assetGridData" ui-grid-move-columns ui-grid-resize-columns ui-grid-selection></div>
</div>
Also it will be good if you can have a fiddle for this issue.
One hacky way to make it is to set
gridOptions.minRowsToShow = rows.length + 0.1
0.1 is needed to completely remove the vertical scrollbar of the grid. If 0.1 doesn't work for you, try a higher value like 0.2.
ui-grid-auto-resize worked in my case

Panel with Collapsible Set and Listview set to em25 too wide in 'Overlay' Mode

I have some nested recursive functions which dynamically create collapsible with listviews that are in a side panel. I found the default 17em to be too small, especially as the nested text starts to get short. So I found the styles in the css which set it and I overrode those to use 25em. This might be a bit too much after testing on some devices. However I digress.
The thing I am here to ask is why my collapsible overflows the panel when I use data-display="overlay", when I set it to 'reveal' it looks fine. I thought it might be all my nested content, so I made a fiddle with static content here: http://jsfiddle.net/LF6UR/
<div data-role="panel" id="left-panel" data-display="overlay" data-position="left" data-position-fixed="true" data-swipe-close="true" data-dismissible="true">
and I can see it is not that, perhaps there is some other CSS property for the panel that I am not aware of. There seem to be lots of niggly little settings to get to know with this framework. Hope someone out there can help because I really think 'overlay' is better than pushing my main content area.
jQM adds a negative left and right margin to collapsibles within the collapsible set. You can override the margin like this:
.ui-collapsible-set .ui-collapsible{
margin-left: 0;
margin-right: 0;
}
Updated FIDDLE
Also, changing your collapsible set to data-inset="true" fixes the issue.
a solution without setting collapsibles to inset...which is important because I have nested collapsibles is to simply set the 'magic' .ui-panel-inner class which JQM puts in as an 'enhancement' but which makes it a bit difficult for traditional webdevelopers to know to apply styles to their controls.
.ui-panel-inner {
/*width: 25em;*/
padding: .2em 1.2em;
}
http://jsfiddle.net/magister/LF6UR/8/

Bootstrap Look and feel in 4.0 Milestone 19 overrides my styles

Loaded Milestone 20 of 4.0 and all my screen layouts and dialogs are trashed.
I use an inline style for the input fields as all my input fields are different sizing, and I see that the Bootstrap look and feel sets a standard size of 206px. It appears to ignore my style.
<xf:secret id="loginUsername" appearance="minimal" xxf:size="8" ref="instance('login')/username" style="width: 80px; verticalAlign: middle;"><xf:label/><xf:hint>User Name</xf:hint></xf:secret><br/>
Any thoughts?
Bootstrap sets a width on input elements, so the width: 80px you set there with your style on the containing span has no effect. I think the best way is to use a class on the xf:secret, and other control, instead of a style, and then use an external CSS to set the width of the input based on that class, with a rule which is stronger than what Bootstrap has.
Since your form is using Bootstrap, I imagine that you created it with Form Builder, in which case see the section Writing your own CSS.

jQuery Mobile: multi-line buttons, in a vertical control group

On my jQuery Mobile page, i'm using a horizontal control group for some buttons.
But in some languages the text within these buttons is too long.
Instead of wrapping the text within each button, the buttons themselves wrap onto the next line.
this is the base code:
<div data-role="controlgroup" data-type="horizontal">
short button
really really really insanely long button is really really insanely long. No really, who makes buttons this big?
</div>
and with this css, we convince it to wrap inside the buttons. Otherwise the text is truncated with an ellipsis
.ui-btn-inner{
white-space: normal !important;
}
On the third page of this fiddle the problem is demonstrated
http://jsfiddle.net/koesper/R8Kwe/
Anyone have any ideas how I might tackle this?
Thanks in advance,
Casper
ps. Inspiration for the original fix came from Tosh in Jquery Mobile Multiline Button
You could set widths for the links in your control-group:
.ui-page .ui-content .ui-controlgroup a {
width : 49%;
}​
This will keep them on the same line. Here is a demo: http://jsfiddle.net/R8Kwe/6/
Also, just to be thorough, the white-space : normal actually needs to be applied to the .ui-btn-text element which is a child of the .ui-btn-inner element (so it still receives the inherited value).
Trim your long buttons - that's a usability issue. If you have action buttons named that long seems like that just defeats the purpose of an action? Other than that I wouldn't use controlgroups for something like this. I would use a custom data theme & some grids to house my buttons inline.

Resources