css

Mask Image, create rectangle from multiple gradients

可紊 提交于 2021-02-16 14:30:09
问题 I have a radial gradient that used as a mask-image "fades" an image in to the background-color behind the image. mask-image: radial-gradient(ellipse at center, rgba(255,255,255,1) 1%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 70%,rgba(255,255,255,0) 100%); How do I get the same effect with an evenly rectangular gradient on all four sides? I know you can combine gradients and my most current attempt does not seem to have any effect: img { mask-image: linear-gradient(to top, rgba(255,255,255,1

Scale the element (and background) but not the content

送分小仙女□ 提交于 2021-02-16 14:30:07
问题 I'm trying to make the hover on an element, making it bigger by few percent, but I'd like to have the title and the contents inside stay where they are. If I just add scale(1.05) to the element, the contents will scale as well. If I try to counter scale the inner element with scale(0.95) the size will be like the original, but the placement won't be the same: .container { display: block; width: 100%; padding: 50px; } .element { height: 562px; width: 590px; display: inline-block; position:

dot slash vs nothing. What is the difference and what's better to use?

﹥>﹥吖頭↗ 提交于 2021-02-16 13:45:09
问题 Just for curiosity. What is the better method to use and what is the difference between them ? <link rel=stylesheet href="./css/css.css"> vs <link rel=stylesheet href="css/css.css"> 回答1: In a relative URI, there is no difference between them. Going without the ./ will save you 2 bytes, so it is marginally better. In a UNIX style shell, leaving the ./ off will search $PATH while including it will search the current directory. Some people might be including the ./ out of habit from working on

Place text on image

吃可爱长大的小学妹 提交于 2021-02-16 13:29:50
问题 I have searched for an answer but can't find one that works for me. How do I get the "HEY YOU" text on top of the image? HTML: <div class="row gallery_container"> <div class="sort_item study"> <a><img src="images/city_1.jpg" class="gallery_project" style="width: 200px; height:200px;"/> <div class="gallery_text"> <h2>HEY</h2> <span>YOU</span> </div> </a> </div> </div> CSS: .gallery_container { width: 850px; display: block; margin: 0 auto; box-sizing: border-box; } .sort_item { box-sizing:

Place text on image

血红的双手。 提交于 2021-02-16 13:29:11
问题 I have searched for an answer but can't find one that works for me. How do I get the "HEY YOU" text on top of the image? HTML: <div class="row gallery_container"> <div class="sort_item study"> <a><img src="images/city_1.jpg" class="gallery_project" style="width: 200px; height:200px;"/> <div class="gallery_text"> <h2>HEY</h2> <span>YOU</span> </div> </a> </div> </div> CSS: .gallery_container { width: 850px; display: block; margin: 0 auto; box-sizing: border-box; } .sort_item { box-sizing:

Place text on image

陌路散爱 提交于 2021-02-16 13:29:05
问题 I have searched for an answer but can't find one that works for me. How do I get the "HEY YOU" text on top of the image? HTML: <div class="row gallery_container"> <div class="sort_item study"> <a><img src="images/city_1.jpg" class="gallery_project" style="width: 200px; height:200px;"/> <div class="gallery_text"> <h2>HEY</h2> <span>YOU</span> </div> </a> </div> </div> CSS: .gallery_container { width: 850px; display: block; margin: 0 auto; box-sizing: border-box; } .sort_item { box-sizing:

Using CSS, is there any way to display different characters using different font?

半腔热情 提交于 2021-02-16 11:54:20
问题 My HTML text is just like this: <p>abcdefghijklmnopqrstuvwxyz</p> What I want is to display a-n using "Times New Roman", and display o-z using "Courier New", and this should be done using CSS, say, with no change to the HTML text. Simply stated, I want CSS to automatically choose the specified font corresponding to which character it is. a-n should be displayed using "Times New Roman"; o-z shoule be displayed using "Courier New". Is there any way to accomplish this? If this problem can be

Using CSS, is there any way to display different characters using different font?

删除回忆录丶 提交于 2021-02-16 11:53:07
问题 My HTML text is just like this: <p>abcdefghijklmnopqrstuvwxyz</p> What I want is to display a-n using "Times New Roman", and display o-z using "Courier New", and this should be done using CSS, say, with no change to the HTML text. Simply stated, I want CSS to automatically choose the specified font corresponding to which character it is. a-n should be displayed using "Times New Roman"; o-z shoule be displayed using "Courier New". Is there any way to accomplish this? If this problem can be

SCSS: parent hover selector

风格不统一 提交于 2021-02-16 10:24:16
问题 In scss we can use a parent selector class: <div class="parent is-active"> <div class="children"></div> </div> .parent { width: 200px; height: 200px; } .children { height: 100px; width: 100px; .is-active & { background: red; } } example How would you write a parent hover selector? 回答1: If I understand your question correctly: https://jsfiddle.net/wx9L9jzj/3/ SCSS: .parent { width: 200px; height: 200px; } .children { height: 100px; width: 100px; .is-active & { background: red; } :hover > & {

SCSS: parent hover selector

不想你离开。 提交于 2021-02-16 10:24:06
问题 In scss we can use a parent selector class: <div class="parent is-active"> <div class="children"></div> </div> .parent { width: 200px; height: 200px; } .children { height: 100px; width: 100px; .is-active & { background: red; } } example How would you write a parent hover selector? 回答1: If I understand your question correctly: https://jsfiddle.net/wx9L9jzj/3/ SCSS: .parent { width: 200px; height: 200px; } .children { height: 100px; width: 100px; .is-active & { background: red; } :hover > & {