center

Centering and aligning width of figcaption tag on image in figure tag

拥有回忆 提交于 2019-12-03 07:58:18
I've spent two days now attempting to resolve a fig/figcation issue to no avail. I have a Django application where users are able to submit images and I'm using the figure and figcaption tags to display the image with an accompanying caption. The main issue is that the caption width exceeds the picture width. I'm trying to figure out a way for the image to remain the same size and the caption to line up in width accordingly. I'm using Twitter-Bootstrap as well. I'm open to all solutions. Any input, experience or advice greatly appreciated. UPDATED: This is the actual HTML template code and CSS

Simple center a object with css and no hacks

帅比萌擦擦* 提交于 2019-12-03 05:41:43
问题 I want to center an object using CSS and no hacks, is this possible and how? I have tried this, but than my p tag is gone. .centered { position: fixed; top: 50%; left: 50%; } 回答1: There's several ways to center an element. But it depends on what your element is and how we choose to display it: If you have {display:inline; } This is simple. You can just use "text-align: center;" to center text, images and divs. If you have {display:block;} This is a bit more difficult. It depends on how your

Scroll to the center of viewport

£可爱£侵袭症+ 提交于 2019-12-03 05:21:39
问题 I would like to center a div by clicking it. So if I'm clicking a div I want it to scroll to the center of the browser viewport. I don't want to use anchor points like the guides and examples I've seen. How can I achieve this? 回答1: In some way you have to identify the clickable elements. I build an example, that uses the class -attribute for that. Step 1 This is the script, that does the work: $('html,body').animate({ scrollTop: $(this).offset().top - ( $(window).height() - $(this)

CSS: Position loading indicator in the center of the screen

浪子不回头ぞ 提交于 2019-12-03 04:49:54
问题 How can I position my loading indicator in the center of the screen. Currently I'm using a little placeholder and it seems to work fine. However, when I scroll down, the loading indicator stays right in that predefined position. How can I make it follow the scrolling so that it always sits on top?? #busy { position: absolute; left: 50%; top: 35%; display: none; background: transparent url("../images/loading-big.gif"); z-index: 1000; height: 31px; width: 31px; } #busy-holder { background:

How to center a textarea using CSS?

寵の児 提交于 2019-12-03 04:43:42
问题 Forgive me for asking such a simple question, I'm new to both HTML and CSS. Is there an easy way to center a textarea? I figured I'd just try using textarea{ margin-left: auto; margin-right: auto; } but it (obviously?) didn't work. 回答1: The margins won't affect the textarea because it is not a block level element, but you can make it display block if you like: textarea { display: block; margin-left: auto; margin-right: auto; } By default, textareas are display: inline , which is why you can

Algorithm for finding a point in an irregular polygon

假装没事ソ 提交于 2019-12-03 03:14:11
Imagagine I have a polygon like the following: I am looking for a C# algorithm with whom I can find a point (could be the middlepoint or also a random point) inside any polygon. For finding the center of mass I used the following algorithm: private Point3d GetPolyLineCentroid(DBObject pObject, double pImageWidth, double pImageHeight) { Point2d[] pointArray = GetPointArrayOfRoomPolygon(pObject); double centroidX = 0.0; double centroidY = 0.0; double signedArea = 0.0; double x0 = 0.0; // Current vertex X double y0 = 0.0; // Current vertex Y double x1 = 0.0; // Next vertex X double y1 = 0.0; //

Getting a CSS element to automatically resize to content width, and at the same time be centered

主宰稳场 提交于 2019-12-03 02:04:56
I have a CSS element, with a border around it, that could have one or multiple boxes in it, so the width of the entire div changes depending on how many boxes are present inside of it. However, I want this whole div to be centered on the screen. Usually, to center things, I just use: margin-left: auto; margin-right: auto; But, this time, I have to either float the element or make it inline-block so the size of the div will be resized to the content, and if I do that, the margin-left and margin-right auto does not work, it always just stays on the left side of the screen. Currently I have:

Left, center, and right align divs on bottom of same line

巧了我就是萌 提交于 2019-12-03 01:43:45
I have three divs that I would like to display on the same line. Each of the three has different widths and heights, and they are not straight text. I'd like to left-align one (all the way to the left), right-align another (all the way to the right), and center the third (in the middle of the containing div, the whole page in this case). In addition, I'd like the three divs to be vertically aligned to the bottom of the containing div. The solution I have vertically aligns them to the top of the containing div. What is the best way to handle this? By setting your container div to position

Centering floating list items <li> inside a div or their <ul>

半城伤御伤魂 提交于 2019-12-02 22:52:02
HTML: <div class="imgcontainer"> <ul> <li><img src="1.jpg" alt="" /></li> <li><img src="2.jpg" alt="" /></li> ..... </ul> </div> I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ul li { float: left; } I set the width of the container as "max-width" so I can make possible to fit the list items (images) to the browser width.. meaning that they will be re-arranged when the browser window re-sized. .imgcontainer{ max-width: 750px; } Now the problem is those images or list items are not aligned to center, they are aligned to the left of

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