css

Extra pixels are being added to span element

微笑、不失礼 提交于 2021-02-19 02:15:07
问题 I can't figure out why but 2 extra pixels are added to the height of a span element. Here is an example: <!DOCTYPE html> <html> <head> </head> <body> <span style="font-size:20px;line-height: 20px"> test </span> </body> </html> In chrome debugger tools the span has a height of 22 pixels. If I change the test element to a div the extra pixels go away. <!DOCTYPE html> <html> <head> </head> <body> <div style="font-size:20px;line-height: 20px"> test </div> </body> </html> here is a fiddle with the

Extra pixels are being added to span element

為{幸葍}努か 提交于 2021-02-19 02:13:24
问题 I can't figure out why but 2 extra pixels are added to the height of a span element. Here is an example: <!DOCTYPE html> <html> <head> </head> <body> <span style="font-size:20px;line-height: 20px"> test </span> </body> </html> In chrome debugger tools the span has a height of 22 pixels. If I change the test element to a div the extra pixels go away. <!DOCTYPE html> <html> <head> </head> <body> <div style="font-size:20px;line-height: 20px"> test </div> </body> </html> here is a fiddle with the

How to hide the toolbar in Chrome for Android tablets for a 100% high website

巧了我就是萌 提交于 2021-02-19 01:29:33
问题 I am trying to make a web application that is 100% of the screen width and 100% of the screen height, with a 16:9 aspect ratio. It would be awesome if I would be able to view this website fullscreen on my tablet, but unfortunately the on-screen toolbar takes up a large amount of space, making my website display neither in full height nor in full width: Now I know that since recently, it is possible to hide the scrollbar by scrolling the page down (source). However, since my web application is

Avoiding duplicated content for responsive page

▼魔方 西西 提交于 2021-02-18 22:37:31
问题 I am currently working on a project dealing with responsive design, and the whole layout should be achieved using HTML and CSS. I know its possible to move content from one column layout to another, without duplicating content, using java script but is the same achievable using HTML and CSS? Take for example the following which would render like this on the desktop design --page------------------- | -------- -------- | | |div 1 | | div 2| | | -------- -------- | ------------------------- But

Run css animation back and forth on clicks

扶醉桌前 提交于 2021-02-18 22:30:07
问题 With css @keyframes I'm trying to attach some animation to an element when it is clicked. .animate { animation-name: action; animation-duration: 2s; animation-timing-function: linear; background-color: green; } @keyframes action { 0% { background-color: gray; } 50% { background-color: red; } 100% { background-color: green; } } DEMO The .animate class is added on click, and the box animates from gray to green. But now I would like to animate back to gray when I click it again (toggle

Animate.css Not working

天大地大妈咪最大 提交于 2021-02-18 22:27:08
问题 I am using animate.css but it don't seem to work in firefox. The code I am using is: <html> <head> <link rel="stylesheet" href="animate.css"/> </head> <body> <div class="rotateIn"> content</div> </body> </html> I want this div to show rotate in effect when we load the page but it don't seem to work. 回答1: you have to use animated class if you want to show animations try this <html> <head> <link rel="stylesheet" href="animate.css"/> </head> <body> <div class="animated rotateIn"> content</div> <

Disable @media print in bootstrap?

时光毁灭记忆、已成空白 提交于 2021-02-18 22:20:35
问题 Is it possible to entirely disable any preconfigured @media print css styles from bootstrap without having to recompile it? The print styles applied by default could be seen here: https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css#L6837 I want my webpage to be printed just as seen, with all css tags applied. Especially colors, like: b { color: #ff0000; } In order to disable the print styles from bootstrap, I'd have to explicit override every property again with my custom

What does it mean to give a div a style='height:100%'?

こ雲淡風輕ζ 提交于 2021-02-18 22:20:06
问题 There's lots of questions on SO related to this, but the ones I scanned are all for detailed specific situations. What I want to know is, at a conceptual level, what does it mean to say: <div style='height:100%'> How high is 100%? 100% of what? [EDIT] Followup question: If 100% represents the height of the parent, but the parent is <body> and has no height other than the height of the div, then what does it mean? It seems recursively defined. 回答1: 100% of the parent container's height. See

How to keep <select> dropdown open to test styles on <option> in firebug?

自古美人都是妖i 提交于 2021-02-18 22:19:32
问题 How to keep <select> dropdown open to test styles on in firebug? I'm trying to styling <option> <select class="select"> <option selected>Select</option> <option>Blue</option> <option >Red</option> <option>Green</option> <option>Yellow</option> <option>Brown</option> </select> But every time i need to open and see what's happening after changing css in firebug. I know it doesn't take much time to open an see the result. But I'm just curious to know if there is any trick to keep the dropdown

CSS: Hidden elements still take up space on printed output

倾然丶 夕夏残阳落幕 提交于 2021-02-18 20:49:40
问题 I'm using css to only print a section of a page: body { visibility:hidden; } .print { visibility:visible; background-color: white; margin: 0; } The section above the element I want to print gets properly hidden in the print output, however it still takes up the area of space. I tested this by making a long vertical list of words. In the print output the same area of white space occurs without the words and then the element output occurs. This problem occurs on chrome and mozilla only. I've