css

How to fit an image inside a Bootstrap 3 div?

主宰稳场 提交于 2021-02-18 10:09:10
问题 I am using a div tag in code as shown below: <div class="col-sm-6 col-md-6 col-lg-4"> <img src="images/dummy_image.png" class="img-responsive"> </div> The user can upload any kind of image and have it displayed here. I want to fit the image inside of the div , meaning specifically that I need to cover the full div using that image as it's resized. I am using Bootstrap 3.3.7. Please advise. 回答1: Just add you images width to 100%. But as you are saying user will upload various kind of images,

Placing an Element to the right side with CSS

馋奶兔 提交于 2021-02-18 10:07:31
问题 I am trying to place a css element to the right side of the header but not sure exactly how to do it. I tried using: position: Absolute; top: 20px; right 0px; That would work but if you adjust the browser the text moves with it. I created a JFiddle that you can find here: http://jsfiddle.net/rKWXQ/ This way you can see what I am trying to do. I have a text inside a wrapped div element that says Call Now (555) 555-5555. Here is the header element and inside of that I have a right_header

Placing an Element to the right side with CSS

旧巷老猫 提交于 2021-02-18 10:06:12
问题 I am trying to place a css element to the right side of the header but not sure exactly how to do it. I tried using: position: Absolute; top: 20px; right 0px; That would work but if you adjust the browser the text moves with it. I created a JFiddle that you can find here: http://jsfiddle.net/rKWXQ/ This way you can see what I am trying to do. I have a text inside a wrapped div element that says Call Now (555) 555-5555. Here is the header element and inside of that I have a right_header

Specify width of 3 chars for an html input text

爱⌒轻易说出口 提交于 2021-02-18 09:00:24
问题 How would I create an HTML text box that exactly 3 characters can fit into it? I found this online: <input type="text" style="width: 10px; padding: 2px; border: 1px solid black"/> It creates a text box with width of 10px. I could use this but I was wondering if we could explicitely set for 3 chars width instead of "playing" with pixels, 回答1: Not reliably, since l and W have very different widths. However, if you set the font to monospace , that helps. Then, you should be able to set size="3"

How to make an iframe responsive without aspect ratio assumption?

流过昼夜 提交于 2021-02-18 08:59:13
问题 How to make an iframe responsive, without assuming an aspect ratio? For example, the content may have any width or height, which is unknown before rendering. Note, you can use Javascript. Example: <div id="iframe-container"> <iframe/> </div> Size this iframe-container so that contents of it barely fit inside without extra space, in other words, there is enough space for content so it can be shown without scrolling, but no excess space. Container wraps the iframe perfectly. This shows how to

How to keep layout unchanged when keyboard is displayed?

佐手、 提交于 2021-02-18 08:45:29
问题 I have a toy example of a html app running in Cordova (code below) which is laid out with everything relative to the viewport size (either position:absolute and percent, or vh units for fonts). Unexpectedly, when a keyboard is shown, the viewport shrinks vertically resulting in the layout shown in the second screenshot. ; I would like the initial layout to be done exactly as it is here, relative to the full width/height of the viewport, but for it to not change size when the keyboard is

CSS Image expanding over parent div size

僤鯓⒐⒋嵵緔 提交于 2021-02-18 08:25:24
问题 The title says most of it. My html: <div class="wrap"> <div class="s-inner"> <figure> <img> </figure> </div> </div> CSS: .wrap{ max-width:500px; max-height:200px; background:red; } .s-inner{ position: relative; margin: inherit; padding:inherit; display: -webkit-flex; display: flex; max-height: 100%; max-width: 100%; box-sizing:inherit; margin:auto; } /* Inside */ .s-inner > figure{ display: block; margin: 0 auto 0 auto; box-sizing: border-box; } .s-inner > figure > img{ box-sizing: border-box

Colored diacritics and unicode behaviour

吃可爱长大的小学妹 提交于 2021-02-18 07:52:12
问题 I just stumbled over this question about coloring diacritics. The task was to color diacritics in another color than the base text, like in á presenting a in blue and ´ in red. I thought I could give it a try, separating letter and diacritic through unicode combining marks, and applying another color to the diacritics by putting a span around it, like this: <p> p<span>̄ </span> o<span>̄ </span> m<span>̃ </span> o<span>̃ </span> d<span>̈ </span> o<span>̈ </span> r<span>̌ </span> o<span>̌ <

Colored diacritics and unicode behaviour

怎甘沉沦 提交于 2021-02-18 07:52:11
问题 I just stumbled over this question about coloring diacritics. The task was to color diacritics in another color than the base text, like in á presenting a in blue and ´ in red. I thought I could give it a try, separating letter and diacritic through unicode combining marks, and applying another color to the diacritics by putting a span around it, like this: <p> p<span>̄ </span> o<span>̄ </span> m<span>̃ </span> o<span>̃ </span> d<span>̈ </span> o<span>̈ </span> r<span>̌ </span> o<span>̌ <

Make SVG path take full width and height of screen

房东的猫 提交于 2021-02-18 07:44:10
问题 I have an inline SVG path that animates a dash to look like the snake game. Now my question is how to get this path to take up the full width and height of the screen and act responsive if the screen goes smaller or bigger. HTML <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 659 522" enable-background="new 0 0 659 522" xml:space="preserve"> <path class="path" width="100%"