document-body

Browser user agent style sheet margin 8px

不羁岁月 提交于 2019-12-21 07:56:32
问题 I was just wonerdering about a white space all around a website. I found out it is there because of the user agent style sheet (Google Chrome) and there is set a margin of 8px to the body tag as default. How to solve this is not a problem, but I am interested in the reason of this margin. I searched for it, but I only find solutions to set the margin zero, but I want to know why this margin is there. Hope you can tell me more about these user agent stylesheets. Greetings Philipp 回答1: Browsers

Firefox ignoring min-height in CSS

房东的猫 提交于 2019-12-20 07:39:50
问题 For some reason, min-height is not working on Firefox. I tried setting min-height on the body, but Firefox totally ignored it. Since my page is dynamic, I cannot just set the height to 100%. What should I do? body { border: 1px solid black; width: 100%; min-height: 100%; } <body> This is the body. </body> 回答1: height percentages are inherited (that includes min-height and max-height, too). From the CSS spec: Specifies a percentage for determining the used value. The percentage is calculated

Firefox ignoring min-height in CSS

谁都会走 提交于 2019-12-20 07:39:00
问题 For some reason, min-height is not working on Firefox. I tried setting min-height on the body, but Firefox totally ignored it. Since my page is dynamic, I cannot just set the height to 100%. What should I do? body { border: 1px solid black; width: 100%; min-height: 100%; } <body> This is the body. </body> 回答1: height percentages are inherited (that includes min-height and max-height, too). From the CSS spec: Specifies a percentage for determining the used value. The percentage is calculated

Scroll listener on body

余生长醉 提交于 2019-12-18 16:31:11
问题 I would like to ask about scroll listener. I want to add scroll listener on body but it seems doesnt work. $('body').scroll(function(){ console.log('SCROLL BODY'); }); I create basic example on fiddle, can someone explain me why it doesn't to work? Sorry for nubies question... 回答1: Try with: $(window).scroll(function(){ console.log('SCROLL BODY'); }); This should be supported by all browsers. 回答2: All the answers above expect jQuery being the framework of use. A framework agnostic / plain JS

Scroll listener on body

一曲冷凌霜 提交于 2019-12-18 16:30:58
问题 I would like to ask about scroll listener. I want to add scroll listener on body but it seems doesnt work. $('body').scroll(function(){ console.log('SCROLL BODY'); }); I create basic example on fiddle, can someone explain me why it doesn't to work? Sorry for nubies question... 回答1: Try with: $(window).scroll(function(){ console.log('SCROLL BODY'); }); This should be supported by all browsers. 回答2: All the answers above expect jQuery being the framework of use. A framework agnostic / plain JS

React changing route breaks height with layout

[亡魂溺海] 提交于 2019-12-12 04:16:10
问题 I have a React application where if I change the route to a page with a small height the entire body doesn't have a max height for the window (the html does have full height). I have a standard index.html setup here <html> <body> <div id="app"></div> <script src="client.min.js"></script> </body> </html> Then here's my App.js file: import React from "react" import ReactDOM from "react-dom" import {Router, hashHistory} from "react-router" import routes from "./Routes" const app = document

HTML email background on body not working in Outlook 2013

情到浓时终转凉″ 提交于 2019-12-11 21:17:04
问题 I have the following html, if i open it up on browser it works fine..but when i send it as a mail to my outlook 2013, i dont see the background.. <!DOCTYPE html> <html> <head> <title>Untitled Document</title> </head> <body style='background-image: url("http://postimg.org/image/t6abf7srn/");background-repeat:no-repeat'> </body> </html> I have tried options 1 and 2 given at this link : http://blog.mailermailer.com/email-design/background-images-in-html-email-the-naked-truth Have tried the

needs 2 clicks to toggle after click on body

社会主义新天地 提交于 2019-12-11 08:45:15
问题 i bet you have seen this happen before. i have a frame appearing on click with toggle() and disappear on body click. problem is, if the frame disappears on body click, it takes 2 clicks to trigger toggle() $('CLASS1').hide(); $('CLASS2').toggle(function(){ $('CLASS1').show(); $("body").click(function(e){ $('CLASS1').hide(); e.stopPropagation(); }); },function(){ $('CLASS1').hide(); }); THANKS! 来源: https://stackoverflow.com/questions/8880313/needs-2-clicks-to-toggle-after-click-on-body

How to find page width in Opera 12 (for Desktop Windows)?

情到浓时终转凉″ 提交于 2019-12-11 02:16:32
问题 I want to access full page width & height in Opera. Note I am not asking about Viewport's height or width, I want page's/document's width & height. I am using Opera 12.12 I have tried the following: document.body.scrollWidth/Height document.body.offsetWidth/Height window.innerWidth/Height document.body.clientWidth/Height And all of them gives viewport's width/height. Please use the following link: http://jsfiddle.net/RQhYR/ Or use the following HTML Page <!DOCTYPE HTML PUBLIC "-//W3C//DTD

click on body except some other tag not working

与世无争的帅哥 提交于 2019-12-10 11:28:38
问题 does anyone know if css position:relative; can mess up the function $('body').not($('.theDIV')).click(function(){ alert(''); }); or the problem is somewhere else? what is happening is i have a that appears on click of a button and i want it to hide() when i click anywhere on the body, except the div itself. HTML <ul class='messages'> //these are made dynamically. should i use each() to go through all the elements? <li> <div class='theDIV'></div> <input type='button'> </li> <li> <div class=