css-position

Why does container size depend on absolute-positioned child?

假装没事ソ 提交于 2019-12-08 02:50:03
问题 I am attempting to build a Skype-like interface with two video boxes: http://jsfiddle.net/q9ER2/20/ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> html, body { background-color: #000000; height: 100%; font-family: Verdana, Arial, Helvetica, sans-serif; } body { margin: 0; padding: 0; } #videoContainer { position: relative; max-width: 800px; } #bigRemote { /* Shrink if necessary */ max-width: 100%; max-height: 100%; }

When to use position absolute vs position relative when vertically aligning with css

感情迁移 提交于 2019-12-07 21:56:39
问题 Originally I followed this article which used position: relative on the child element: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ http://codepen.io/anon/pen/KpWKWg But I couldn't get it to work on my code for the life of me: http://jsfiddle.net/ge77ma0e/ Then I found these instructions which use position: absolute on the child element: https://css-tricks.com/centering-css-complete-guide/#vertical-block-unknown http://codepen.io/chriscoyier/pen/lpema And when I

How do I get a vertical scroll bar on an inner div contained in a fixed dimension outer div?

狂风中的少年 提交于 2019-12-07 21:54:58
问题 I'm looking for an HTML/CSS solution where an inner DIV has the following characteristics: MUST HAVE: is included within a fixed height container div below a variable height sibling header div. fills available variable height with no max-height CSS property scrolls vertically if necessary to accommodate content is within a document having DOCTYPE = HTML 4.01 strict (preferably, HTML 5 if necessary) is multi-browser compatible (Chrome, Firefox, IE, Safari, mobile-phone browsers) WOULD LIKE TO

How can I position a large number of absolute divs with a small amount of CSS?

时光怂恿深爱的人放手 提交于 2019-12-07 17:23:12
问题 I need a way to make a div repeat a certain number (36) of times vertically, with 1px of space between each one. The divs are absolutely positioned, so styling each one individually would be a ton of CSS. I don't mind putting 36 divs into the HTML directly, although I'd prefer not to, but styling each one would be inefficient. 回答1: How about nest them? you can nest them with relative positioning or maybe some margin: http://jsfiddle.net/zWbUu/ HTML div id="container"> <div class="square">

Positioning two divs, one with fixed width(left div) and other in percentage(right div)

旧时模样 提交于 2019-12-07 14:43:59
问题 As the title says, i wanted to place two divs horizontally in a single line. The left side div is of fixed width(which contains an image) while the right side div should occupy the rest of the space. CSS: .container{ width:100%; background-color:#000000; height:auto; } .inner_left{ width:150px; float:left; height:250px; background-color:#FF0000; } .inner_right{ float:left; height:250px; width:78%; } HTML : <div class="container"> <div class="inner_left">test</div> <div class="inner_right">Nam

how to 'fix' the header footer position using jquery mobile with data-position=“fixed”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 10:07:01
问题 i am using jquery mobile and for header/footer i am using data-position="fixed". However, when we scroll the page... the header footer goes away ands reappear when scrolling stops.. Is there a way we could just make it fixed on the screen an show all the time you are scrolling ? I can only think of a way is to apply position fixed and not use jquerymobile for these elements.. 回答1: I tried my best to get this to work. If you want you can delete the function that changes the header and footer

Display span over input with HTML+CSS

会有一股神秘感。 提交于 2019-12-07 08:18:55
问题 I want to display a span element over an input element with CSS. How can I do this. My current code: <input type="url" placeholder="e.g. www.google.com" /> <span>http://</span> How can I display the span element on the input element so that the users know there is no need to enter http:// so it would look like if there's already a value in but then it is the span element on the input? I assume I can do that with CSS positioning. I cannot use placeholder as I don't want it to be removed. 回答1:

CSS Position Fixed Not Working in IE 11

 ̄綄美尐妖づ 提交于 2019-12-07 05:52:17
问题 I have an image gallery, with captions across the bottom (upper image). The captions use position:fixed; bottom:0; , and works in every browser but IE, even the latest version (11.096…). The caption is fixed to the top of the screen, instead of the bottom (lower image). I tried some of the suggestions I found while researching this on my own: Verified the correct doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> Added <meta http-equiv="X-UA-Compatible" content="IE

Jquery based image mosaic wall layouts

橙三吉。 提交于 2019-12-07 05:07:29
I'm looking to recreate the layout that's present at this site: http://prettytasty.tumblr.com/archive/ The only way to accomplish this is using absolute positioning, however it appears that they're using javascript to dynamically position each image entry on the page. Is there a jquery plugin or example that accomplishes this or something similar? I realize javascript is the last thing you want to have to depend on for layout, but I'm just curious and would like to see how it is accomplished. Yi Jiang The effect you see on that particular page is actually created with prototype.js, but for

Allow absolutely positioned element to be wider than parent absolutely positioned element

*爱你&永不变心* 提交于 2019-12-07 04:49:46
问题 Background I have a small one-level CSS flyout menu (well, technically it's an expanding element). It is absolutely positioned at the bottom left of a parent absolutely-positioned element that is fairly narrow. See the second h1 element below: <div id="controls"> <h1>Controls 1</h1> <h1 id="size" class="poplinks button"> Size <a href="#" class="button selected" title="small"><img src=""></a> <a href="#" class="button" title="medium"><img src=""></a> <a href="#" class="button" title="large">