positioning

Why does a nested HTML element make my CSS jump?

与世无争的帅哥 提交于 2019-12-12 11:56:58
问题 Here's a puzzle. Basic page, one element: http://jsfiddle.net/PZj6t/ HTML: <div id="container"></div>​ CSS: body, html { height: 100%; margin: 0; padding: 0; background-color: black; } #container { position: relative; margin: 0 auto; width: 400px; height: 100%; background-color: #666; } ​ That one looks how I want, with the #container neatly flush to the top. But when I add a nested element: http://jsfiddle.net/PZj6t/1/ HTML: <div id="container"> <nav id="topnav"></nav> </div>​ CSS (new):

Control draggable movement in jQuery

柔情痞子 提交于 2019-12-12 09:43:23
问题 how can I control de movement of a draggable in jquery? I need to do something similar to the "snap to grid" where the draggable moves every "x" and "y" pixels I can't use "grid: [x, y]" (2D) because I need to make the drag on an isometric grid (3D) (I will develop the grid later, I first need to controll the drag) for example: when I start the dragging, the draggable shouldn't move, it has to snap to another position when the "x" and "y" are under certain conditions thanks in advance! 回答1:

Bottom to top <ul> element arrangement

时光毁灭记忆、已成空白 提交于 2019-12-12 08:21:20
问题 I'm trying to find out how I can force elements to start from the bottom going to the top. I have searched through stackoverflow and I can't seem to get the answer that i need. This picture should explain it: This should help too: <?php require("connectdb.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;

Image below sidebar

痴心易碎 提交于 2019-12-12 06:59:04
问题 I have a CSS layout as in this picture. I'd like to achieve the following behaviour img should be always below left sidebar (as in the picture). Problem is that left sidebar contains a list of collapse/expand links and when you expand it the img overlaps with left sidebar and text is unreadable. thank you 回答1: HTML <div id="container"> <div id="header">ert</div> <div id="left-sidebar">sdfsdfsdft <div id="img">IMG</div></div> <div id="right-sidebar">ert</div> <div id="content">aaert</div> <

How to force div to fill empty space on left side of another, higher div [duplicate]

邮差的信 提交于 2019-12-12 06:58:21
问题 This question already has answers here : How to Create Grid/Tile View? (8 answers) Closed 3 years ago . Please look at the example below. I'm trying to put my yellow div under red div and on the left side of bottom half of green . If i use clear: left it will jump down, but it lefts empty space above. I want it to fill this space. Here's example: https://jsfiddle.net/enqqr2w8/ 回答1: #redyellow { width: 100px; height: 200px; float: left; } #red { width: 100px; height: 100px; background-color:

HTML z-index and positioning

醉酒当歌 提交于 2019-12-12 06:09:40
问题 I'm trying to make a html/css based poker program and at the moment im trying to figure out how I am going to put the chips on the table or move my chat window on table. my code is in index.html <body> <div id="content"> <div id="table"> <div id="boardImage"><img src="./img/poker_table_new.png" /></div> </div> <div id="chat"> <textarea id="chatBox"></textarea> <input id="message" type="text"> <input id="sendButton" type="submit" value="Send"> </div> </div> and in CSS #content { position

Issue with addMouseMotionListener getting wrong coordinates

筅森魡賤 提交于 2019-12-12 04:46:09
问题 I borrowed the class below to make a selection area tool for a project. But it has a issue when I try to make a selection when the content is not aligned at top-left, it get my mouse coordinates related to the ScrollPane, but draws over the image - See this SS for better understanding: sscce : import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; import java.awt

Absolute positioning

邮差的信 提交于 2019-12-12 04:14:44
问题 I'm trying to understand the basics of positioning, and I came across this example on the internet that displays specific properties. Essentially, they created two boxes with CSS: #box_1 { width: 200px; height: 200px; background: #ee3e64; } #box_2 { position: absolute; left: 100px; width: 200px; height: 200px; background: #44accf; } Because absolute positioning places the container in relation to its first parent element, shouldn't the second box be placed at the top of the browser, and then

How would I make a image scale with the browser or screen resolution with css

淺唱寂寞╮ 提交于 2019-12-12 03:52:08
问题 I am working on a page for my mybb forum and I added some images and I want them to scale with the screen resolution so if I have a 17" it looks the same as someone with a 19" screen. Because right now the images just look all messed up. Here is the page that I am working on. http://crescentgaming.com/forums/test.php 回答1: In your CSS, use percents. HTML <img src="/folder/whatever.jpg"> CSS img{ width: 45%; } Of course, you could switch it to whatever percent you want. There is a more

How to save portlet positions

荒凉一梦 提交于 2019-12-12 03:45:16
问题 I will be using jQuery's functionality to create portlet widgets for my web application suit. I haven't started as of yet, but will do soon, so this is the planning Now, currently, the page loads, and the widgets load into their default positions. A user can move them around, change their settings, whatever. Now, my problem is that I want it such that the widget placement is saved for the user, not just per session, but as an account variable. I am using PHP and MySQL for the level-base