Pixels are static values which may work for certain dimensions but will cause problems and hinder design at different dimensions/views(mobile-desktop)
For responsive web design it is a must to follow certain design practices :
1- No Pinch Zoom: Solved by applying viewport correctly.
2- No Horizontal Scrolling: Solved by using relative sizing and positioning and instead of absolute positioning.
3- Font-size Handling: Use em and rems instead of pixels.
4- Layout: Use Media Queries,Flexboxes, Bootstrap etc.
function fetxa() {
const diasSemana = ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"];
const meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Júnio", "Júlio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
var fexa = new Date();
var hoy = diasSemana[fexa.getUTCDay()];
var dia = fexa.getUTCDate();
var mes = meses[fexa.getUTCMonth()];
var any = fexa.getUTCFullYear();
document.getElementById("fecha").innerHTML = `<span>${hoy} ${dia}, del mes de ${mes} del ${any}</span>`;
}
<!-- jQuery -->
<script src="//code.jquery.com/jquery-latest.js"></script>
<!-- Popper -->
<script src="https://unpkg.com/@popperjs/core@2"></script>
<!-- Tippy -->
<script src="https://unpkg.com/tippy.js@6"></script>
<script language="javascript">
// This code will execute as soon as the document is loaded
$(document).ready(function() {
// Allow or disallow html in tooltips (default = false)
tippy.setDefaultProps({allowHTML: true});
// Transform elements
let tooltip_elements = $('a[href^="#tooltip_"]');
tooltip_elements.each(function(i){
let link = $(this).attr('href');
let tip = link.replace('#tooltip_', '');
$(this).attr('data-tippy-content', tip);
if (link.startsWith('#tooltip_')) {
$(this).removeAttr('href').css('cursor', 'pointer');
}
});
// Finally, call `tippy`
tippy('[data-tippy-content]');
});</script>
/* ----------------------------------------
Note: any modifications to these styles will be global
---------------------------------------- */
.tippy-box {}
.tippy-content {}
.tippy-arrow {}
/* ----------------------------------------
You can also apply tooltip css overrides on the INTERIOR of your tooltips. Note: results may sometimes be unpredictable 😡
---------------------------------------- */
.tippy-box .style1 {
font-family: courier;
color: #0066FF;
padding: 15px;
display: inline-block;
}
Comments