My project is to create a video streaming app using NextJS, where I want to display a video and also its subtitles.
Problem:
In Chrome browser the subtitles have a background and I want to remove it (or change its height):
In Firefox or Safari it all works fine.
My code:
margin: auto;
outline-offset: 0.5px;
outline: 100vw solid
rgba(32, 35, 37, 0.85);
background-image: linear-gradient(
to bottom,
rgba(32, 35, 37, 0.85),
rgba(32, 35, 37, 0.85)
);
I also tried background-color but it is not working.
Is there any solution?
Related
I have angular7 application and i have wrote my own class, for my button. the code of the button and the class "btn-baya" is like the following code .
<a [routerLink]='["/eval-detail",evaluation.id]' class=" btn-baya">En savoir plus</a>
.btn-baya {
background-color: rgba(243, 116, 33) !important;
color: #ffffff !important;
cursor: pointer;
}
this code works on all browsers but not ie10 and edge !! any solutions please
The rgba color expression needs 4 values. From it's name — "red", "green", "blue", "alpha". You only have three.
Either specify alpha:
rgba(243, 116, 33, 1)
Or use rgb():
rgb(243, 116, 33)
I want to create this background in CSS only.
I want to do it with CSS to avoid responsive issues.
You can make use of radial-gradient to produce the glow effect. You can change the colors to be inline with the image.
One thing you should note is the browser support for CSS gradients. IE < 10 do not support them. If you need support for older browsers then CSS gradients would not help.
body {
background-image: radial-gradient(circle, rgb(49, 144, 228) 0%, rgb(29, 84, 166) 100%);
height: 100vh;
}
<!-- prefix free library included only to avoid vendor prefixes -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
I can't see any extra steps in between but if you are looking for several steps of varying percentages then have a look at the below snippet:
body {
background-image: radial-gradient(circle, rgb(49, 144, 228) 0%, rgb(41, 122, 204) 30%, rgb(29, 84, 166) 70%);
height: 100vh;
}
<!-- prefix free library included only to avoid vendor prefixes -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
I am making a small web based tool, but running into a problem, both background and hr tags break when the page is larger in width then the initial viewable area. In other words, once I scroll sideways!
EDIT: This needs to work for chrome. (Or possibly firefox if not possible in chrome)
Also, thanks to Celts response I can possibly solve the hr issue, background is still not repeating as it should!
However in my real app I don't know the width of the page, as its content and layout are dynamic. (This I could work around with javascript if needed)
Html code for replicating the problem:
And apparently I cant post pictures here yet. So links to the 2 pictures:
Initial view: http://imgur.com/HdHedgk
Scrolled View: http://imgur.com/hh2wgE4
body {
background: repeating-linear-gradient(
90deg,
rgba(96, 109, 188, 0.31),
rgba(96, 109, 188, 0.30) 100px,
rgba(70, 82, 152, 0.31) 100px,
rgba(70, 82, 152, 0.31) 200px
)
}
<div style="width: 100%; margin-top: 60px">
<hr>
</div>
<div style="position: absolute; width: 4000px">
Text goes here
</div>
Because you are setting the div's width to 100% this means it will only ever be as big as the initial screen size that your page loads on. The hr tag inside the 100% width div it is getting cut off for this reason. To prevent this from happening set your 100% width div to the same size as the one below it.
This code works fine in chrome:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<style>
body {
background: repeating-linear-gradient(
90deg,
rgba(96, 109, 188, 0.31),
rgba(96, 109, 188, 0.30) 350px,
rgba(70, 82, 152, 0.31) 350px,
rgba(70, 82, 152, 0.31) 700px
)
}
</style>
</head>
<body>
<div style="width: 4000px; margin-top: 60px">
<hr>
</div>
<div style="position: absolute; width: 4000px">
Text goes here
</div>
</body>
</html>
You should really build your styles into a separate style sheet. It is good practice and will make future maintenance of the web page much easier.
UPDATE:
To solve your repeating background problem you can change your background style to use percentages instead of pixels:
<style>
body {
background: repeating-linear-gradient(
90deg,
rgba(96, 109, 188, 0.31),
rgba(96, 109, 188, 0.30) 10%,
rgba(70, 82, 152, 0.31) 10%,
rgba(70, 82, 152, 0.31) 20%
)
}
</style>
body background is defined in inline css as
body {
background: radial-gradient( #EAC39F, rgb(255, 208, 160),#CB690C);
}
In real web sites latest Internet Explorer shows horizontal lines in background.
In IE developer tools I turned all other styles in body off, tried 2-color gradient, linear gradient and other colors, but problem persists.
How to force IE to show background without horizontal lines ?
Chrome shows proper background. Also Internet explorer shows proper background if only this style is used. Page
<html>
<head>
<style type="text/css">
body {
background: radial-gradient( #EAC39F, #CB690C);
}
</style>
</head><html><body></body></html>
is shown properly. If there are more elements in page, horizontal lines appear.
How to remove those lines in Internet Explorer ?
jquery and jquery-UI are used in page.
Since IE does not apply height to body, either you apply a fixed height to body or you apply a 100% heightto html tag in your CSS,
and if you don't need the background to repeat, apply, background-repeat:no-repeat.
Also If you are looking for a cross-browser support then you should use the vendors browsers.
Here is a snippet working in IE10+:
html {
height: 100%
}
body {
background: rgba(234, 195, 159, 1);
/* Old Browsers */
background: -moz-radial-gradient(center, ellipse cover, rgba(234, 195, 159, 1) 0%, rgba(203, 104, 12, 1) 100%);
/* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(234, 195, 159, 1)), color-stop(100%, rgba(203, 104, 12, 1)));
/* Chrome, Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(234, 195, 159, 1) 0%, rgba(203, 104, 12, 1) 100%);
/* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(234, 195, 159, 1) 0%, rgba(203, 104, 12, 1) 100%);
/* Opera 11.10+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(234, 195, 159, 1) 0%, rgba(203, 104, 12, 1) 100%);
/* IE 10+ */
background: radial-gradient(ellipse at center, rgba(234, 195, 159, 1) 0%, rgba(203, 104, 12, 1) 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#eac39f', endColorstr='#cb680c', GradientType=1);
/* IE6-9 fallback on horizontal gradient */
background-repeat: no-repeat
}
The issue appears to stem from the fact that IE is not applying a height to the body element. As such the background gets repeated and you see the lines.
By applying
body {
background: radial-gradient( #EAC39F, rgb(255, 208, 160),#CB690C);
}
A similar effect can be seen at http://jsfiddle.net/xpz2tgp9/ in Chrome, IE, etc.
To resolve your issue, apply a specific height to the body element or add a clearing div that will force the body to have height value.
html,body
{
height: 100%;
margin: 0;
padding: 0;
}
See - http://jsfiddle.net/xpz2tgp9/1/
I'm just wondering why in IE that the button is grey and then when you hover over the button goes blue, it should be blue and then when hover over it goes darker blue.
I've got it working in other browsers but I can't figure out the code for IE.
Thanks in advance.
Here is the CSS:
#mc_embed_signup .button {
background-image: linear-gradient(center top , rgb(95, 176, 244), rgb(70, 130, 180));
background-image: -o-linear-gradient(center top , rgb(95, 176, 244), rgb(70, 130, 180));
background-image: -moz-linear-gradient(center top , rgb(95, 176, 244), rgb(70, 130, 180));
background-image: -webkit-linear-gradient(center top , rgb(95, 176, 244), rgb(70, 130, 180));
background-image: -ms-linear-gradient(center top , rgb(95, 176, 244), rgb(70, 130, 180));
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(1, rgb(95, 176, 244)),
color-stop(1, rgb(70, 130, 180))
);}
And here is the HTML for the button:
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
It's actually live in the footer of http://www.housebuyfast.co.uk. It's the subscribe button under "Join Our Mailing List Now".
IE9 and earlier does not support standard CSS gradients.
IE10 does support them, and your code should work fine in IE10 (unless it's in compatibility mode).
If you need to use gradients in IE9 or earlier, you have a few options:
Use IE's proprietary -ms-filter style. Something like this:
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999');
Use a polyfill script like CSS3Pie. This will allow the standard CSS gradients to work in older IE versions.
It is because the version of IE that you are using does not support gradients.
More info at: http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx
Basically it isn't supported until IE10, but as other posters point out there are alternatives.
Use CSS3PIE for makes Internet Explorer 6-9 capable of rendering several of the most useful CSS3 decoration features http://css3pie.com/