centering

How to extend Twitter Bootstrap image carousel for dynamically sized, centered images

社会主义新天地 提交于 2019-12-03 03:04:12
I'm trying to extend the default Bootstrap image carousel to support dynamically sized images (500x400 max), centered both horizontally and vertically. Additionally, I'd like to maintain the original caption layout, which anchors the caption to the bottom of the image, with the caption div extending fully across the image (but no further.) I've put together a fiddle, which is a fairly clean implementation of the default Bootstrap setup (there are only 4 additional styles at the end of the css section): http://jsfiddle.net/rdugan/JFBFU/26/ I can fairly easily accomplish the horizontal centering

How do I align text to the middle of an element with CSS in Twitter Bootstrap?

不想你离开。 提交于 2019-12-03 02:54:35
I am using Bootstrap alerts and this is my success alert message: <div class="alert alert-success" id="UploadSuccess"> <a class="close" data-dismiss="alert">×</a> <strong>Congrats!</strong> You have successfully did it!. </div> And the result is: As you'll can see that the text alignment is at the top of the <div> . So, how would II align it to the middle? I have tried using padding-top and vertical-align:middle but neither works (I end up with the same result). What do I need to do to change the vertical alignment of the text? Make the line-height of the div the same as the height of the div,

Adding bottom margin to ListView last element

﹥>﹥吖頭↗ 提交于 2019-12-03 01:25:27
问题 I need to add to add ListView with complicated items background: different for even/odd and rounded corners at the top and bottom. It looks like this: I have implemented all this stuff via level-list, but there is one more thing I want to do. Now the bottom item is near the bottom of the screen. It is better to add some space. I don't want to add bottom margin to ListView, I need margin only for last item. The ways I see to do this: Footer A kind of hack – add footer with empty TextView to

Center unordered list in DIV

感情迁移 提交于 2019-12-03 00:36:33
First of all, I know this question has been asked a MILLION times...and I've looked at this one specifically as well as several others on this site and other sites. I've tried a ton of different variations on each of these and still can't get it to work. I'm trying to center an unordered list. It displays correctly, it's just not centered. At the moment, it's CLOSE to center...but if you change the "width" parameter in the .nav-container code in the CSS then it shifts the position of the div. Here is my CSS: html *{ font-family: Verdana, Geneva, sans-serif; } body { padding:0px; margin:0px; }

Zoomable JScrollPane - setViewPosition fails to update

廉价感情. 提交于 2019-12-03 00:24:27
I'm trying to code a zoom-able image in a JScrollPane. When the image is fully zoomed out it should be centered horizontally and vertically. When both scroll bars have appeared the zooming should always happen relative to the mouse coordinate, i.e. the same point of the image should be under the mouse before and after the zoom event. I have almost achieves my goal. Unfortunately the "scrollPane.getViewport().setViewPosition()" method sometimes fails to update the view position correctly. Calling the method twice (hack!) overcomes the issue in most cases, but the view still flickers. I have no

How to center links in HTML

匆匆过客 提交于 2019-12-02 22:42:28
I am really new to HTML and was wondering how you center multiple links with html? I have been trying : <a href="http//www.google.com"><p style="text-align:center">Search</a> But the problem is when I try to put other links behind it for example: <a href="http//www.google.com"><p style="text-align:center">Search</a><a href="Contact Us"><p style="text-align:center">Contact Us</a></p> It just places them on separate lines. I believe this is happening because of the <p> function...but I only know HTML, I know you can do it in CSS but I was wondering if it can be done using just HTML. Thanks for

Centering bitmap Marker (Google Maps Android API v2)

别来无恙 提交于 2019-12-02 18:42:00
When I add a marker from a custom Bitmap, the marker is not centered at the point I specify. I'm adding it like this: // ID tramo final int tramoId = tr.getId(); // Nodos final Nodo[] nodos = tr.getNodos(); final PolylineOptions p = new PolylineOptions(); MarkerOptions m = new MarkerOptions(); // Seteamos posicion de linea y marker m.position(semisuma(nodos)); for (final Nodo n : nodos) { p.add(n.getLatLng()); } // Color de linea y marker BitmapDescriptor icon = null; if (tr.getCapacidad() == 0) { p.color(0xFF000000); m = null; } else if (tr.getCapacidad() - tr.getPlazasOcupadas() == 0) { p

Adding bottom margin to ListView last element

眉间皱痕 提交于 2019-12-02 14:48:08
I need to add to add ListView with complicated items background: different for even/odd and rounded corners at the top and bottom. It looks like this: I have implemented all this stuff via level-list, but there is one more thing I want to do. Now the bottom item is near the bottom of the screen. It is better to add some space. I don't want to add bottom margin to ListView, I need margin only for last item. The ways I see to do this: Footer A kind of hack – add footer with empty TextView to ListView. But footers are quite unstable things, they usually disappear after notifyDataSetChanged and

N-by-2 grid, and if the last row has only a single column, center it

我与影子孤独终老i 提交于 2019-12-02 05:41:02
问题 I want to have an N-by-2 grid like this, in which some elements (columns) might be set to display:none based on run-time factors, making the number of rows and columns unknown in advance at the design time. So it could look like this: 1 2 3 4 5 or 1 2 4 5 (3 is missing) or 1 3 (2, 5 is missing) 4 (4 is the last column) I want the last element to be always centered. I make each div .col-xs-6 to make the grid N-by-2. What can I do to make the last column to always be in center? Last column,

Center div in parent with only min-height, and child may without height & with relative position

核能气质少年 提交于 2019-12-02 03:33:08
so I have a div which is min-height 100%; (100% of the screen or more). The child holds the content and needs to be centered vertically, but it might extend the parent to more than 100% of its size. This child is variable in height. So is there a way with only css(3) to do this? hungerstar Use the display: table; and display: table-cell; properties. The outer DIV will need to have display: table; and the inner DIV display: table-cell; along with vertical-align: middle; . Now you will be mimicing the default display of a td . CSS .parent { min-height: 100%; display: table; } .child { display: