css3

CSS square with dynamic height

我们两清 提交于 2019-12-30 11:53:32
问题 I need to make a div square. The height of the div is dynamically changing and I want the width to be equal to the height. I have seen a lot of solutions to set the height to be equal to the width (with padding-bottom on pseudo-elements), but I need it the other way arround. Is this possible with pure CSS? 回答1: No .... well, there is this trick, where one use a hidden image div { display: inline-block; height: 170px; background: red; } div img { visibility: hidden; height: 100%; } <div> <img

How to make gutter between columns in a CSS grid system

依然范特西╮ 提交于 2019-12-30 11:51:14
问题 Does anyone know how to make a 20px or 1em gutter for the grid system below? I got all the div s to all go in a row but I want to know how to add a gutter in between each div. I'm doing this to learn how grids are made. jsFiddle Here. body { font:20px/1.2 Verdana, Arial; padding:0px; margin:0px; } *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing:border-box; } .row { width:100%; } .row > [class*='col-'] { /* ... */ } .row > [class*='col-']:last-of

Box shadow not working in microsoft edge

二次信任 提交于 2019-12-30 11:49:52
问题 Box-shadow not working on Microsoft Edge browser. I have implemented the follow in the section: (I'm not an idiot I have at the top) <meta http-equiv="X-UA-Compatible" content="IE=edge"> This is the body of my index.html file: <body> <div id="wrapper"> <header> <div id="header-inner"> <div id="logo"> <a href="index.html">body</a> </div> <ul> <li><a href="index.html">Home</a></li> <li><a id="sign-in" href="#">Sign in</a> <span id="sign-in-menu"> <div class="arrow-up"></div> <div class="arrow

How to create 'Slide-in gallery panels' with jQuery/CSS3? [closed]

陌路散爱 提交于 2019-12-30 11:39:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Normally I know how to start off, have a few tutorials or even experience, but at this point I don't even know how to call it. Perhaps just by telling me how to correctly define this could be a solution to my problem (-> based upon name, I can correctly search). Let's give you

How to create 'Slide-in gallery panels' with jQuery/CSS3? [closed]

霸气de小男生 提交于 2019-12-30 11:39:04
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Normally I know how to start off, have a few tutorials or even experience, but at this point I don't even know how to call it. Perhaps just by telling me how to correctly define this could be a solution to my problem (-> based upon name, I can correctly search). Let's give you

CSS3 image frame-border z-index

ⅰ亾dé卋堺 提交于 2019-12-30 11:08:36
问题 I have the following markup for my images: img.framed { border-image: url('../images/design/frame.png') 40 40 40 40 stretch stretch; border-color: #f4be52; border-style: inset; border-width: 40px; } And I am getting this result: I don't like, that image inside frame overrides part of my frame. How can I modify my code to get frame displayed over the image? Like that: 回答1: Some part of the image would have to be hidden to create what you want. Create the main div that has your image, and

Menu style “…” - fill in with periods

≯℡__Kan透↙ 提交于 2019-12-30 11:07:47
问题 I have been trying to find the best way to create the "....." effect like in a dinner menu: http://cl.ly/0g263j04322m3F140D40 Not sure if it has to be done with just adding in the periods myself or if there is a way to have jQuery or CSS3 to fill it in. Just curious. Any ideas on what I can do? Or back to the old fashion way of adding periods. 回答1: Try this CSS2 solution. HTML: <ul> <li><span>Soup</span><span>€ 2.99</span></li> <li><span>Ice cream</span><span>€ 5.99</span></li> <li><span

Menu style “…” - fill in with periods

你离开我真会死。 提交于 2019-12-30 11:07:21
问题 I have been trying to find the best way to create the "....." effect like in a dinner menu: http://cl.ly/0g263j04322m3F140D40 Not sure if it has to be done with just adding in the periods myself or if there is a way to have jQuery or CSS3 to fill it in. Just curious. Any ideas on what I can do? Or back to the old fashion way of adding periods. 回答1: Try this CSS2 solution. HTML: <ul> <li><span>Soup</span><span>€ 2.99</span></li> <li><span>Ice cream</span><span>€ 5.99</span></li> <li><span

nested flex elements don't make parent grow

寵の児 提交于 2019-12-30 10:53:09
问题 I'm trying to compose a header with month names and all days in that month right below the name. Days items have fixed width so I thought: why not use flexbox? For some reasons .day elements are falling of their parent and parent does not grow. Could you please give me a hint why flex-basis: auto doesn't make month-slot grow after days' slot overflow it? As for implementation I've already found workaround with using float: left instead of using flexbox. But I cannot understand why it works

Why is an element with width:100% not taking the parent's width?

笑着哭i 提交于 2019-12-30 10:43:51
问题 I am facing the issue that I cannot set the same width as its parent inside a flexbox item. Here is the code and the span with the class theSpan doesn't have the same width as its parent. .container { display: flex; } .item1 { flex: 1 1 200px; border: 5px solid yellow; } .item2 { flex: 1 1 200px; border: 5px solid blue; } .item3 { flex: 1 1 200px; border: 5px solid red; } .theSpan { width: 100%; border: 2px solid black; } <div class='container'> <div class='item1'> <span class='theSpan'