I've created a simple church directory in which I edited the CSS to change one of the default Map Markers to one of my own. The issue that I am having is that the Map marker is displayed correctly on Chrome and Safari but not Firefox IE or Edge.
copticchurch-directory.org
Code
/*
Theme Name: Listify Child
Theme URI: http://astoundify.com/themes/listify
Template: listify
Version: 1.0
*/
.job_listing-rating-wrapper,
.map-marker-info .rating,
.single-comment-rating,
.star-rating-wrapper {
display: none !important;
}
.type-job_listing.style-grid .job_listing-entry-footer {
display: none;
}
.ion-information-circled
{
content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/Map-Marker1.svg);
}
.ion-ios.information-circled
{
content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/Map-Marker1.svg);
}
.ion.md.information-circled
{
content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/Map-Marker1.svg);
}
The problem is with the use of the content property on regular elements. Use instead the background property, which will have better cross-browser support.
Change the following:
.ion-information-circled {
content: url(...);
}
Into this:
.map-marker .ion-information-circled::before {
content: "";
background: url(...)
}
https://jsfiddle.net/eyvetdz4/2/
Related
Links below are accurate and match up with attached images. Reproduction is possible as described below.
I am developing a website using HTML, CSS, and JavaScript: https://github.com/nkozlo3/PortfolioWebsite.git
Website: https://nkozlo3.github.io/PortfolioWebsite/
The website looks correct on Chrome, Firefox, and Microsoft Edge. Also on laptops of different sizes: Chrome view 1 Microsoft Edge view 1
Firefox view is the same.
But when viewed through Safari, the elements reposition themselves like so:
Safari view 1
To reproduce the problem simply visit the website on Safari through the above link or pull the code from my GitHub (link above) and run it through Safari.
I tried putting this wrapper around the body of my HTML
<div id="wrapper" style="margin-left: auto; margin-right: auto; width: 960px">
and adding this meta tag
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
I was expecting this to force the content to stay in the correct spots across devices and websites, but it did not solve the issue on Safari.
I also tried adding the below reset.css file to my style.css file to normalize across different browsers. This also did not solve the issue on Safari:
/***
The new CSS reset - version 1.8.2 (last updated 23.12.2022)
GitHub page: https://github.com/elad2412/the-new-css-reset
***/
/*
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
- The "symbol *" part is to solve Firefox SVG sprite bug
*/
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
all: unset;
display: revert;
}
/* Preferred box-sizing value */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Reapply the pointer cursor for anchor tags */
a, button {
cursor: revert;
}
/* Remove list styles (bullets/numbers) */
ol, ul, menu {
list-style: none;
}
/* For images to not be able to exceed their container */
img {
max-inline-size: 100%;
max-block-size: 100%;
}
/* removes spacing between cells in tables */
table {
border-collapse: collapse;
}
/* Safari - solving issue when using user-select:none on the <body> text input doesn't working */
input, textarea {
-webkit-user-select: auto;
}
/* revert the 'white-space' property for textarea elements on Safari */
textarea {
white-space: revert;
}
/* minimum style to allow to style meter element */
meter {
-webkit-appearance: revert;
appearance: revert;
}
/* preformatted text - use only for this feature */
pre {
all: revert;
}
/* reset default text opacity of input placeholder */
::placeholder {
color: unset;
}
/* remove default dot (•) sign */
::marker {
content: "";
}
/* fix the feature of 'hidden' attribute.
display:revert; revert to element instead of attribute */
:where([hidden]) {
display: none;
}
/* revert for bug in Chromium browsers
- fix for the content editable attribute will work properly.
- webkit-user-select: auto; added for Safari in case of using user-select:none on wrapper element*/
:where([contenteditable]:not([contenteditable="false"])) {
-moz-user-modify: read-write;
-webkit-user-modify: read-write;
overflow-wrap: break-word;
-webkit-line-break: after-white-space;
-webkit-user-select: auto;
}
/* apply back the draggable feature - exist only in Chromium and Safari */
:where([draggable="true"]) {
-webkit-user-drag: element;
}
/* Revert Modal native behavior */
:where(dialog:modal) {
all: revert;
}
Been fighting with ng-smart-table trying to find an elegant way to remove the Column Filter placeholder without overriding the javascript. I know i can modify node_modules the module within that directory but i need to modify this inside the component. Any ideas?
Here are my column settings. I've tried to modify the cell but nothing seems to override the placeholder which displays the name of the column.
public settings: any = {
actions: false,
noDataMessage: 'Loading... please wait!',
filtering: {filterString: ''},
className: ['table-striped', 'table-bordered'],
columns: {
customerName: {
title: 'Account',
class: 'topHeading',
},
}
I had the same problem just now and couldn't find any good workarounds posted anywhere. I ended up making the color of the placeholder the same color as the background of the input to "hide" the placeholder.
// Hide the placeholders in all browsers
.ng2-smart-filter input::-webkit-input-placeholder {
/* WebKit browsers */
color: #fff;
}
.ng2-smart-filter input::-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #fff;
}
.ng2-smart-filter input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #fff;
}
.ng2-smart-filter input::-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #fff;
}
Is it possible to style text tracks (like subtitles and captions) in HTML5 video players?
I already found a way to do so for Chrome:
video::-webkit-media-text-track-container {
// Style the container
}
video::-webkit-media-text-track-background {
// Style the text background
}
video::-webkit-media-text-track-display {
// Style the text itself
}
This seems to confuse Safari a bit. It works, but the rendering is quite buggy.
But more important: How to achieve do this for Firefox and IE?
The only cross-browser solution I have found to date is: Hide the video’s text tracks and use your own.
This will allow you to create your own text nodes, with classes, id’s etc. which can then be styled simply via css.
In order to do so, you would utilize the onenter and onexit methods of the text cues in order to implement your own text nodes.
var video = document.querySelector(‘YOUR_VIDEO_SELECTOR’)
tracks = video.textTracks[0],
tracks.mode = 'hidden', // must occur before cues is retrieved
cues = tracks.cues;
var replaceText = function(text) {
$('WHERE_TEXT_GETS_INSERTED').html(text);
},
showText = function() {
$('WHERE_TEXT_GETS_INSERTED').show();
},
hideText = function() {
$('WHERE_TEXT_GETS_INSERTED').hide();
},
cueEnter = function() {
replaceText(this.text);
showText();
},
cueExit = function() {
hideText();
},
videoLoaded = function(e) {
for (var i in cues) {
var cue = cues[i];
cue.onenter = cueEnter;
cue.onexit = cueExit;
}
},
playVideo = function(e) {
video.play();
};
video.addEventListener('loadedmetadata', videoLoaded);
video.addEventLister('load', playVideo);
video.load();
Use this for Chrome:
video::cue {
// add style here
}
Firefox:
Not yet supported. Open bug to implement ::cue pseudo-element -
https://bugzilla.mozilla.org/show_bug.cgi?id=865395
Edit:
Support for FireFox is available, it works similarly as it does in Chrome and Opera. But support is not yet available for Edge or IE.
I set out to style my captions to have a black background and be positioned below the video for Safari and Chrome. I have achieved success with the following code combined with editing the .vtt file with the following styles. Note you must add the styles to the .vtt file or else in safari your captions will jump around when the video controls (even if they're hidden) would appear:
4
00:00:09.980 --> 00:00:12.640 line:13 position:50% align:middle
size:100%
for just the summer but I ended up staying here.
Styles for chrome and safari captions:
Chrome uses the video::cue background-color and opacity.
video::cue {
opacity: 1;
background-color: black;
font-size: 20px !important;
}
Safari uses -webkit-media-text-track-display-backdrop for it's background color. Note the !important which overrides Safari's inherent styling.
video::-webkit-media-text-track-display-backdrop {
background-color: black !important;
overflow: visible !important;
}
The following webkit-media-text-track-display overflow is allow for more padding around Chrome's caption text:
video::-webkit-media-text-track-display {
overflow: visible !important;
}
Overflow visible is important on the following code for Safari and I'm setting the captions below the video with the transform, which is reliant on a fixed font-size:
video::-webkit-media-text-track-container {
overflow: visible !important;
transform: translateY(30%) !important;
}
EDIT
With some tweaking I ended up using this for my project:
Important: Delete all inline styling from your .VTT file.
Determine if the user is using chrome or safari.
const rootElement = document.getElementById('root');
const M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
rootElement.className += "web";
if(M[1] === 'chrome'){
rootElement.className += " chrome";
} else {
rootElement.className += " safari";
}
Then in a SASS .scss file use the following styles. NOTE: If you're not using SASS you can simply create a class for the video element and nest the corresponding styles.
.chrome {
video::cue {
font-size: 24px;
opacity: 1;
background-color: black;
-webkit-transform: translateY(10%) !important;
transform: translateY(10%) !important;
}
video::-webkit-media-text-track-display {
overflow: visible !important;
-webkit-box-sizing: border-box;
background: black;
padding: 8px;
border-radius: 16px;
}
video::-webkit-media-text-track-container {
overflow: visible !important;
-webkit-transform: translateY(40%) !important;
transform: translateY(40%) !important;
position: relative;
}
}
.safari {
video::cue {
font-size: 24px;
opacity: 1;
background-color: black;
}
video::-webkit-media-text-track-display-backdrop {
background-color: black !important;
overflow: visible !important;
}
video::-webkit-media-text-track-display {
overflow: visible !important;
-webkit-box-sizing: border-box;
}
video::-webkit-media-text-track-container {
overflow: visible !important;
-webkit-transform: translateY(20%) !important;
transform: translateY(20%) !important;
position: absolute;
}
}
This is working for chrome,
video::-webkit-media-text-track-container {
// Style the container
}
video::-webkit-media-text-track-background {
// Style the text background
}
video::-webkit-media-text-track-display {
// Style the text itself
}
you can also get some information from those links.
Link 1
Link 2
html
<video >
<source ref="videoSource">
<track default kind="subtitles" src="xxx" />
</video>
//custom element for showing subtitle
<div ref='subtitleTrackWrapper' v-show='showTextTrack'></div>
javascript
let textTrack = [your video tag].textTracks[0]
textTrack.mode = 'hidden'
textTrack.addEventListener('cuechange', () => {
const cues = textTrack.activeCues;
if(cues.length>0){
this.showTextTrack = true
this.$refs.subtitleTrackWrapper.innerHTML = cues[0].text
}else{
this.showTextTrack = false
}
});
I have a CSS rule which is working in all browsers but IE. When I check it in the IE inspector I can see that the rule is not being applied.
.wrapper:after {
content: '';
display: table;
clear: both;
}
Any idea why this rule is not being applied in IE?
I'm testing on IE 11, 10 & 9. I'm working on a Magento app.
I was able to solve this issue by re-writing the css rule to:
.wrapper:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
I don't understand why the previous rule did not work on IE, while it worked in all other browsers. The previous rule was being inherited from the Magento RWD theme.
Also, it seems that the IE inspector crosses out all :after rules, which is misleading as some of them are actually working on the page.
Is there any css hack for ff 3.5 and older (not 3.6) i used
.SubTabs ul, x:-moz-any-link
{
/* IE7,6 Hack*/
*top: -28px;
}
but this applies to all FF browser versions..
Well solved it some what not 100% perfect but should work
/// <reference path="jquery-1.3.2-vsdoc2.js" />
$(document).ready(function() {
if ($.browser.mozilla) {
$('body').addClass("mozilla");
var versionParts = $.browser.version.split("\.");
var version = 0;
if (versionParts.length > 0) {
version = version + versionParts[0] * 1000000000000;
}
if (versionParts.length > 1) {
version = version + versionParts[1] * 1000000000;
}
if (versionParts.length > 2) {
version = version + versionParts[2] * 1000000;
}
if (versionParts.length > 3) {
version = version + versionParts[3] * 1000;
}
if (version >= 1009002000000) {
$('body').addClass("mozilla3-6andAbove");
}
else {
$('body').addClass("mozilla3-5andBelow");
}
}
});
now you can add body.mozilla3-5andBelow in your css file and it should work...
Use the #-moz-document at-rule to target any version of Firefox, then override that selector for Firefox 3.6+ using the #media -moz-scrollbar-start-backward media query:
#-moz-document url-prefix()
{
.SubTabs ul
{
top: -28px;
}
}
/* Firefox 3.6+ Filter */
#-moz-document url-prefix()
{
#media -moz-scrollbar-start-backward
{
.SubTabs ul
{
top: -10px;
}
}
}
Creating Firefox hacks for low end versions do require one for all, and a second one to override.
Here are a couple I created that do this.
The first one I posted to browserhacks.com so you may recognize it:
/* Firefox (any) */
_:-moz-tree-row(hover), .selector { top: 0px; }
Then the Override:
/* Firefox 3.6 and newer (use this to override) */
_:-moz-handler-crashed, :root .selector { top: -28px; }
To test these and many others live, you can try them out on my live css hacks test page: http://browserstrangeness.bitbucket.org/css_hacks.html#firefox
Enjoy!