I have a problem with a scroll issue in Edge,
It seems that it has something to do with the base element being sticky
Here is the site link http://www.power-sonic.co.uk/drm/#section1
When you scroll it should show content to the right of the image, it works on all other browsers other than edge..
However if I change the wrapper element to position: sticky it works but its very laggy,
Is there a better fix and why would there be an issue with position relative in Edge (if thats even the issue).
HTML:
<div class="bg-parralax responsive-hide">
<section class="services-types container services-types-web">
<div class="item is-business">
<div class="pin-wrapper">
<div class="image"></div>
<div id="section1" class="font-o title">
<h3>ABOUT THE DRM SYSTEM</h3>
</div>
</div>
</div>
<div id="test" class="item is-consumers">
<div class="pin-wrapper">
<div class="image"></div>
<div class="titles">
<div class="text-block">
<h4>Designed by experts</h4>
<p>Power Sonic has been a leading force within the power solutions
industry for nearly fifty years. The same amount of expertise, quality
control and innovation has gone into developing the DRM system.
The cutting edge software has been designed to specifically operate
the technology to maximize efficiency and reliability.</p>
</div>
<div class="text-block">
<h4>Fully compliant to import and export power</h4>
<p>The DRM system is designed to operate with grid systems to import
and export power with the voltage and frequency regulations
including, FFR and DFFR schemes required by utilities to support the
grid. The DRM system can be used to support the stabilization of the
power grid.</p>
</div>
<div class="text-block">
<h4>Complete solution</h4>
<p>Our DRM system has everything needed to connect to a building or
utility network. It is incredibly easy to install, integrate and maintain.</p>
</div>
</div>
</div>
</div>
<div class="item bullets is-consumer">
<div class="pin-wrapper">
<div class="image"></div>
<div class="list text-block">
<ul>
<li style="margin-left: 0px;" class="hide-bullet"><h4>FEATURES</h4></li>
<li>Ultra high efficiency</li>
<li>High performance in any climate</li>
<li>Modular, flexible and scalable</li>
<li>Smart energy management</li>
<li>Multi grid support functions</li>
<li>Innovative demand response software</li>
<li>Reliable, field proven technology</li>
<li>Compatible with different storage technologies</li>
</ul>
</div>
</div>
</div>
</section>
</div>
SCSS:
.services-types .item {
height: 100vh;
position: relative;
}
.scrollmagic-pin-spacer {
position: absolute !important;
clip: rect(auto, auto, auto, auto);
width: 100%;
height: 100% !important;
}
.pin-wrapper {
height: 100%;
}
.services-types-web .item.is-business .image {
background-image: url("images/container-cutout.svg");
top: 50%;
margin-top: -200px;
width: 50%;
height: 463px;
position: absolute;
background-size: 100%;
background-position: center center;
background-repeat: no-repeat;
}
.services-types-web .item.is-consumers .image {
background-image: url("images/container-cutout.svg");
top: -50%;
margin-top: -200px;
width: 50%;
height: 463px;
position: absolute;
background-size: 100%;
background-position: center center;
background-repeat: no-repeat;
}
.services-types-web .item.is-consumer .image {
background-image: url("images/container-cutout.svg");
top: -50%;
margin-top: -200px;
width: 50%;
height: 463px;
position: absolute;
background-position: center center;
background-size: 100%;
background-repeat: no-repeat;
}
.title {
color: #3f434a;
position: absolute;
top: 50%;
left: 70%;
transform: translate(-50%, -50%);
text-transform: uppercase;
font-weight: 600;
width: 600px;
font-size: 55px;
text-align: center;
h3 {
font-size: 70px
}
}
.titles {
color: #3f434a;
position: absolute;
top: -44%;
left: 70%;
transform: translate(-50%, -50%);
font-size: 18px;
text-align: left;
width: 40%;
}
.list {
position: absolute;
top: -50%;
left: 71.5%;
transform: translate(-50%, -50%);
font-size: 22px;
text-align: left;
width: 40%;
}
.list li {
margin-bottom: 12px;
margin-left: 18px;
}
Im also using scroll magic to control the scroll changes but I don't think that is causing the issue but if anyone thinks its is I can include that code too.
here's what I found:
I tested your site and found the "image" element and the "edge-hide image" element perform incorrectly in Edge: When the text "ABOUT THE DRM SYSTEM" of "item is-business" appears, the 1st "image" shows well, then the 1st item text disappears and the 2nd text block of "item is-consumers" turns to its max opacity, the 1st "image" element is still visible while the 2nd "edge-hide image" of the 2nd wrapper is invisible, likewise, the 3rd item's "edge-hide image" is also invisible.
I also tested the site in Chrome, it works in a different way: When the 1st item text disappears and the 2nd text block of "item is-consumers" turns to its max opacity, the 1st "image" element becomes invisible and the 2nd "edge-hide image" of the 2nd wrapper becomes visible, as well as the 3rd item's "edge-hide image".
There may be some compatibility issue in Edge with JavaScript. Could you please share your js source files especially "sitea45afa79f7f3c8c24697.js"?
Related
I'm currently facing an issue regarding a Text over an image.
Here is my css code :
.box{
position: relative;
display: inline-block; /* Make the width of box same as image */
}
.box .text{
position: absolute;
z-index: 999;
margin: 0 auto;
left: 0;
right: 0;
text-align: center;
top: 40%; /* Adjust this value to move the positioned div up and down */
background: rgba(0, 0, 0, 0.8);
font-family: Arial,sans-serif;
color: #fff;
width: 60%; /* Set the width of the positioned div */
}
Here is my html :
<div class="box">
<img src="name.jpg" alt="">
<div class="text">
SpinnerBait Brochet
</div>
</div>
Here is how it looks like in codepen.io :
BUT, when i'm adding my html in my wordpress I have a completely different rendering.
I do have my picture where I added it in the page BUT my text is in the middle of my page (and not in the middle of my image...)
Do you have any idea what could be the issue ?
Thanks
By looking at your question my guess is that you are trying to center the text on top of the image.
Try the following:
HTML:
<div class="box">
<img src="https://via.placeholder.com/350" alt="Placeholder">
<div class="text">
SpinnerBait Brochet
</div>
</div>
CSS:
.box {
display: inline-block;
position: relative;
}
.box .text {
display: inline;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #000;
color: #fff;
}
CodePen here.
Essentially what the CSS is doing is:
Positioning the text absolutely in the center of it's relative container:
display: inline;
position: absolute;
top: 50%;
left: 50%;
Changing the starting position of the X and Y axes points to the true center of the element.
transform: translate(-50%, -50%);
I want to change the background color of a div when hover over it, depending on an icon inside the same div.
Do someone know what to use (CSS, Bootstrap ...) to do it in easy way, and how?
That is an example link:
https://appsource.microsoft.com/en-us/marketplace/apps
And that is a picture if you don't want to open the link:
The effect you're looking for is possible by re-using the exact same image enlarged a few times (~10), overlapped with position:absolute with a huge blur factor, while trimming its overflow:
.card {
height: 250px;
width: 150px;
margin: 1rem;
display: inline-block;
border: 1px solid #eee;
border-radius: 6px;
}
.top-bar {
padding: 1rem;
position: relative;
overflow: hidden;
border-radius: 4px 4px 0 0;
}
.top-bar img {
width: 36px;
z-index: 1;
position: relative;
}
.top-bar img.blur {
position: absolute;
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 512px;
filter: blur(51.2px);
opacity: .07;
}
.card:hover img.blur {
opacity: .42;
}
<div class="card">
<div class="top-bar">
<img src="https://i.picsum.photos/id/10/2500/1667.jpg?hmac=J04WWC_ebchx3WwzbM-Z4_KC_LeLBWr5LZMaAkWkF68">
<img class="blur" src="https://i.picsum.photos/id/10/2500/1667.jpg?hmac=J04WWC_ebchx3WwzbM-Z4_KC_LeLBWr5LZMaAkWkF68">
</div>
</div>
<div class="card">
<div class="top-bar">
<img src="https://i.picsum.photos/id/102/4320/3240.jpg?hmac=ico2KysoswVG8E8r550V_afIWN963F6ygTVrqHeHeRc">
<img class="blur" src="https://i.picsum.photos/id/102/4320/3240.jpg?hmac=ico2KysoswVG8E8r550V_afIWN963F6ygTVrqHeHeRc">
</div>
</div>
<div class="card">
<div class="top-bar">
<img src="https://i.picsum.photos/id/1022/6000/3376.jpg?hmac=FBA9Qbec8NfDlxj8xLhV9k3DQEKEc-3zxkQM-hmfcy0">
<img class="blur" src="https://i.picsum.photos/id/1022/6000/3376.jpg?hmac=FBA9Qbec8NfDlxj8xLhV9k3DQEKEc-3zxkQM-hmfcy0">
</div>
</div>
You can further improve this by adding a JS that simply copies the <img> on the fly and applies class .blur to it (so you don't have to manually add two images to each card).
Note css-filters don't yet have full browser support.
In the example you linked, the blur is done using SVG <filter> (slightly better browser support) and a <feGaussianBlur>, but the principle is the same.
Does anyone know how to place text after a container and it still be centered. Anyone know how to fix this? For some reason, If I don't put the position at the end if the program, it will go behind the banner picture, and if I when I try to center it doesn't work. I want them both centered, but the example to be after the banner, but whenever I try, it won't let me put the text at the right height, and be centered at the same time
.container {
position: relative;
text-align: center;
color: white;
}
.top-left {
position: absolute;
top: -8px;
left: -10px;
}
.bottom-left {
position: relative;
top: 29vh;
left:50%;
transform: translate(-50%, -50%);
}
<div class="container">
<img align="left">
<div class="top-left">
<img src="C:\Users\wadeb\OneDrive\Desktop\Untitled design.png" alt="Banner Picture" style="width:100vw;height:33vh" style="margin: 0px px"></p>
</div>
<div class="bottom-left">
Home
</div>
<h3 style=" text-decoration-style: bold; position: absolute;top:34vh; text-align: center;">example:</h3>
</div>
Any Ideas?
You are doing it all wrong, you shouldnt do img align like that simply add it after img url like this
<img src="url" align="left">
Are you asking for them both to be centered? If you are you can simply add <center> tag before container div and both will be centered. Be more precise.
I found the answer at How to center a "position: absolute" element
all I had to do was add
left: 0%;
right: 0%;
text-align: center;
I then simply did this
<span style="position: absolute; top: 38vh; left: 0%;right: 0%; text-align: center;">
What I'm trying to accomplish is making a box where the text will be exactly the same size relative to the box, no matter by what method the box is resized.
In the code below, the "small_box" has the intended behavior, it follows the bigger box no matter what, but the text does not. I would need the text to follow it as well.
Here's the codepen https://codepen.io/anon/pen/RxKowB (try resizing the window to see the behavior)
.box {
border: 2px solid black;
}
.box__frame {
width: 100%;
padding-bottom: 120%;
position: relative;
}
.box__small_box {
position: absolute;
top: 4%;
left: 10%;
width: 20%;
padding-bottom: 10%;
}
.box__text {
position: absolute;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.box__text_name {
font-size: 8vw;
top: 60%;
}
.box__text_body {
text-align: center;
font-size: 5vw;
top: 70%;
}
<div style="max-width:800px;">
<div class="box box__frame">
<div class="box box__small_box"></div>
<div class="box__text box__text_name">
This is the title
</div>
<div class="box__text box__text_body">
This is the long description. This is the long description. This is the long description.
</div>
</div>
</div>
The solution may not be possible using CSS alone if the text is floating.
These libraries maybe of some help.
http://simplefocus.com/flowtype/
http://fittextjs.com/
so I'm trying to tame the Footer so that it stays below the dynamic content container, but whatever way I try it (Pos: Abs, Bottom: 0; etc etc) it either appears halfway up the content or fixed at the bottom. Either I don't want. It would be appreciated if someone could shine a light on my problem.
HTML:
<div id="Content">
<div id="G6"></div>
<div id="Post-Block">
<div id="block">
<div id="feat-img"></div>
<div id="date"></div>
</div>
</div>
<div id="Footer">
<div id="G7"></div>
<div id="FooterBreak"></div>
<div id="FooterBG"></div>
<div id="FooterLinks">
</div>
<div id="Copyright">
</div>
<div id="Copyright2">
</div>
<div id="FooterBreak2"></div>
</div>
</div>
CSS:
#Footer {
width: 100%;
height: 230px;
position: absolute;
left: 0;
bottom: 0;
}
#Content {
z-index: 7;
background: url(/images/content%20bg.jpg) repeat left top;
position: absolute;
top: 336px;
width: 999px;
height: auto;
color: #fff;
min-height: 950px;
margin: 0 0 230px;
}
html {
position: relative;
height: auto !important;
}
body {
z-index: 0;
background: url(/images/background-texture%20d.jpg);
left: 0;
}
#page {
z-index: 1;
width: 1000px;
height: 1000px;
margin-left: auto;
margin-right: auto;
}
EDIT: When I used the Chrome dev tools to inspect the Crow's Perch website, it looks like your problem is that the height of your HTML is smaller than your content (ie, you use negative bottom values in your absolute positioning for some of your content). Given this, you could add bottom: -865 to #footer, but given that you said your content is dynamic, that's an EXTREMELY brittle solution. Unfortunately, since you're pixel-pushing all of your elements, I don't think there's a way to have your footer respond dynamically to your changing content. More comprehensive refactoring of your code is likely necessary.
Good luck!