html5 – How Important Are Tags for SEO?

What do you think? Seems to me that adding <main></main> tags around your page content tells Google what content is most important and unique to this page. Google then knows to only look at the content and links within the tags for indexing. It can largely ignore <header>, <nav>, <aside>, and <footer> content. Anyone agree? Anyone able to cite an authoritative resource on this subject?

I know WordPress automatically adds <main> tags around page content. Seems Google likes WordPress sites, say over Weebly, Wix, or SquareSpace … or other drag n’ drop site builders. I wonder if it’s partly because WP is good with HTML5 semantic tags. I even see WP drag n’ drop editors (like Elementor) omit HTML5 markup tags by default. And likely the developer is unaware and doesn’t go back and add them. Are those sites hurting their SEO? Does omitting HTML5 markup, specifically <main> make it more difficult for Google to index and understand the page?

I’m surprised I can’t find much on this topic on the internet.

html5 – Accuracy of html style and coding conventions, and comments

HTML isn’t intended for humans to read (but still it can be read), so that’s more of a training, not real work. Real production HTML is better stripped of comments and spaces, minified and zipped to save network traffic. But if you need it to be readable…

Use validator

The only formal error here can be found immediately by an online validator: <footer> tag is out of <body>.

<strong> is not bold

The <strong> HTML element indicates that its contents have strong importance, seriousness, or urgency. It is shown in bold, but if you need bold font – use CSS, not <strong> tag.

Line width

If you need the code to be read by humans, limit string width. Traditional maximum width is somewhere near 80 symbols per line (80 or 78), but with modern wide screens you can make it some wider; check out how you see your code on this site. Break long lines.

If comments start at the same distance, it makes clear for reader they are of the same kind. Like

<!DOCTYPE html>           <!--Declare the doctype as the html standard of HTML 5-->
<html lang="en-us">       <!--Lang Attribute to declare the language of a webpage-->

<head>                    <!--Every html doc needs a head which contains important 
                           information for viewing the code on different devices.-->
  <meta charset="UTF-8">  <!--The declaration of correct character encoding ensures 
                           proper interpretation and indexing for search purposes.-->

html5 – What would you tell about HTML 5/JavaScript browser gamedev to somebody who has been in a coma since 2014?

In 2014, I last attempted to make a browser game with HTML 5 and JS. That’s now 7 years ago. But it feels like 7 weeks, tops.

If this has been the the difference between 1994 and 2001 (instead of between 2014 and 2021), it would’ve felt like two different eras of human history. I have a feeling that not much has changed in the last seven years, however, but please prove me wrong.

One of the major issues I remember having was how bad HTML 5 Audio was. In order to get panning and volume changes, we were forced to rely on an Adobe Flash hack, which essentially made our games require Flash even though they were HTML 5-based except for simply outputting the sound. I assume that this is no longer the case.

To make it clear, I’m talking about “raw” coding in HTML 5 Canvas with plain JavaScript. I’m not talking about using some framework/library to hold my hand. And this is not because I’m such a masterful coder or anything, but simply because I found it more confusing to use any of the existing gamedev libraries at the time, and I suspect this is still the same. Keep in mind that I cannot afford to pay a single dollar, so any payware library (which may be great) is out of the question right from the very start.

Sorry if this is considered “too broad”, but what should I know about the current “landscape”, and have there been major/fundamental changes in the HTML 5 APIs, Canvas performance, etc.? Since 99.99% of all browsers now use Chrome under the hood, it feels like the “web” is now to be considered “Chrome” in practice. I mean, I don’t even have a Chromium-based browser installed at all. I only have Pale Moon (Firefox fork). I probably will download and test my stuff in NW.js, though, which is using Chromium.

I probably should mention that I was never able to figure out how to use WebGL, and that library (Three.js?) was so badly documented/designed that I could never figure out how to use it. Is the “good old” HTML 5 Canvas still not hardware-accelerated?

Porto – Responsive HTML5 Template

Admin submitted a new resource:

Porto – Responsive HTML5 Template – Porto – Responsive HTML5 Template

View attachment 33398

Porto Responsive HTML5 Template is a responsive HTML5 template for any site with over 600 pages. Style variations, template style change panel, fast loading, SEO optimized and more …

Read more about this resource…

.

html5 – Como “Concatenar” páginas em html usando apenas o input type=”submit”

html5 – Como “Concatenar” páginas em html usando apenas o input type=”submit” – Stack Overflow em Português

html5 – Divs criadas em JavaScript

Eu estou criando meio que uma playlist (até o momento tudo nela funciona como esperado) e fiz um detalhe pra seleção de músicas onde eu criei pra cada música uma div com o nome da música, e ao invés de criar elemento por elemento por cada música na pasta eu fiz um laço pra criar divs separadas e adicionar em outra:

var musicas = ('Aqui', 'vai', 'o', 'nome', 'das', 'músicas');
var musics = document.querySelector('.musics');
i = 0;

while(i < musicas.length) {
    var nome_musicas = document.createElement('div');
    musics.appendChild(nome_musicas);
    nome_musicas.classList.add('name');
    nome_musicas.classList.add('music_number_' + i);
    nome_musicas.innerHTML = musicas(i);
    i++;
}

Meu problema agora é achar uma lógica de, quando eu clicar na div com a música ela me dar o nome da música que está dentro dela para ai eu fazer outro passo pra tocar a música selecionada.

html5 – como ativar e desativar uma função onclick no javascript

<div onclick="theme()" class="theme">
    <img id ="theme"src="elements/dark.svg"/>
</div>```

______________________________________________

let bodydark = document.getElementById('body');

function theme() {
    document.getElementById("theme").src="elements/light.png";
    change_theme();
}

function change_theme() {
    bodydark.style.background = 'var(--overlay)';
    
    let div_wrapper = document.getElementById("q1").style.backgroundColor = '#091b38';
    let div_wrapper1 = document.getElementById("q2").style.backgroundColor = '#091b38';
    let div_wrapper2 = document.getElementById("q3").style.backgroundColor = '#091b38';
}

Basicamente esse código ao clicar na div uma funçao theme() altera o src da div e muda o tema para dark, gostaria que fosse possível ao clicar novamente na div voltar ao padrão, parecido como o alterar tema do google chrome. Por favor me ajudemm! não sei se a palavra certa seria desativar a funcao ja existente, mas eu tentei colocar 2 functions dentro da div, uma para mudar o tema e outra pra dar um reloader na página, mas meio que uma entra em conflito na outra e executa as duas ao mesmo tempo e a pagina fica dark e recarrega assim por diante!

Draw shapes using the Html5 Canvas api

A while ago I decided to start working on a project that will keep me busy for a while and will help me sharpen my programming skills.
I do not underestimate the work behind apps like adobe xd, sketch.app, or figma but I just want to understand how those apps work and if I can do something similar.

The features of an app like this would allow me to experiment with a wide range of techniques, each one helping me in my journey to become a better programmer.

Here is a link to my little app: draw

I picked Vue/vuex for state management but apart from that there is nothing Vue specific in it.
Most of the relevant code is in: src/components/canvas.

The downside of working on your own project is that you do not get any guidance from more experienced developers and this is the reason why I’m here on codereview.

Before I write even more code and losing control of whatever I’m doing, I would like to ask you to take a look at my code, review it, make suggestion and guide me if possible.

For example, this is the Shape class that allows me to draw some shapes on the canvas:

import { degreesToRadians, mouseIsInsideEllipse, mouseIsInsideRectangle } from '@/helpers/geometry';
import { PolarCoordinate, Shadow, ShapeCoords, ShapeName, Stroke } from '@/Types/types';
import { uid } from 'uid';
import { RadiusHandle, ResizeHandle } from './handles';

export class Shape {
    public id = '';
    public x = 0;
    public y = 0;
    public endX = 0;
    public endY = 0;
    public width = 0;
    public height = 0;
    public stroke: Stroke | null = null;
    public fill = '';
    public type: ShapeName | '' = '';
    public rotation = 0;
    public radius: number() | null = null;
    public shadow: Shadow | null = null;
    private _isMoving = false;
    private _isSelected = false;
    public radiusHandles: RadiusHandle() | null =  null;
    public resizeHandles: ResizeHandle() = ();
    
    constructor(type: ShapeName, shapeProperties: {coords?: ShapeCoords, stroke?: Stroke, fill?: string}, copyShape?: {x: number, y: number, h: number, w: number}) {
        this.id = uid(12);

        if(type === 'RECTANGLE') {
            this.radius = (0, 0, 0, 0);
        }

        if(shapeProperties.coords) {
            if(type === 'LINE') {
                this.x = shapeProperties.coords.start.x;
                this.y = shapeProperties.coords.start.y;
                this.endX = shapeProperties.coords.end.x;
                this.endY = shapeProperties.coords.end.y;
            } else {
                const isNegativeWidth = shapeProperties.coords.end.x <= shapeProperties.coords.start.x;
                const isNegativeHeight = shapeProperties.coords.end.y <= shapeProperties.coords.start.y;

                if(isNegativeWidth) {
                    this.x = shapeProperties.coords.end.x;
                    this.width = Math.abs(shapeProperties.coords.start.x - shapeProperties.coords.end.x);
                } else {
                    this.x = shapeProperties.coords.start.x;
                    this.width = Math.abs(shapeProperties.coords.end.x - shapeProperties.coords.start.x);
                }

                if(isNegativeHeight) {
                    this.y = shapeProperties.coords.end.y;
                    this.height = Math.abs(shapeProperties.coords.start.y - shapeProperties.coords.end.y);
                } else {
                    this.y = shapeProperties.coords.start.y;
                    this.height = Math.abs(shapeProperties.coords.end.y - shapeProperties.coords.start.y);
                }
            }
        }
        if(copyShape) {
            this.x = copyShape.x;
            this.y = copyShape.y;
            this.width = copyShape.w;
            this.height = copyShape.h;
        }

        this.stroke = shapeProperties.stroke ? shapeProperties.stroke : null;
        this.fill = shapeProperties.fill ? shapeProperties.fill : '';
        this.type = type;
    }

    private roundedRectangle(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number()) {
        ctx.beginPath();
        ctx.moveTo(x + radius(0), y);
        ctx.lineTo(x + width - radius(1), y);
        ctx.quadraticCurveTo(x + width, y, x + width, y + radius(1));
        ctx.lineTo(x + width, y + height - radius(2));
        ctx.quadraticCurveTo(x + width, y + height, x + width - radius(2), y + height);
        ctx.lineTo(x + radius(3), y + height);
        ctx.quadraticCurveTo(x, y + height, x, y + height - radius(3));
        ctx.lineTo(x, y + radius(0));
        ctx.quadraticCurveTo(x, y, x + radius(0), y);
        ctx.closePath();
    }

    private applyShadow(ctx: CanvasRenderingContext2D) {
        ctx.shadowColor = this.shadow!.color;
        ctx.shadowBlur = this.shadow!.blur;
        ctx.shadowOffsetX = this.shadow!.x;
        ctx.shadowOffsetY = this.shadow!.y;
    }

    private drawLineResizeHandles(ctx: CanvasRenderingContext2D) {
        ctx.setLineDash(());
        new ResizeHandle('W', {x: this.x, y: this.y}, Math.abs(this.endX - this.x), Math.abs(this.endY - this.y), ctx);
        // new ResizeHandle('E', {x: this.endX, y: this.endY}, Math.abs(this.endX - this.x), Math.abs(this.endY - this.y), ctx);
    }

    private drawResizeHandles(ctx: CanvasRenderingContext2D) {
        ctx.setLineDash(());
        ctx.lineWidth = 1;
        ctx.strokeStyle = '#00a7f9';
        ctx.strokeRect(this.x, this.y, this.width, this.height);

        const handleCoordinate = ("NW", "NE", "SW", "SE", "N", "S", "W", "E") as PolarCoordinate();
        this.resizeHandles = ();

        handleCoordinate.forEach(polarPosition=> {
            this.resizeHandles = (...this.resizeHandles, new ResizeHandle(polarPosition, {x: this.x, y: this.y}, this.width, this.height, ctx));
        });

        const text = `${this.width} x ${this.height}`;
        const infoBoxH = 16;
        const textWidth = ctx.measureText(text).width;
        const infoBoxW = textWidth + 16;

        ctx.fillStyle = 'rgba(0, 166, 249, 0.7)';
        ctx.fillRect(this.x + this.width / 2 - infoBoxW / 2, this.y + this.height + 16 - infoBoxH / 2, infoBoxW, infoBoxH);
        ctx.fillStyle = "#ffffff";
        ctx.textAlign = "center";
        ctx.font = "12px Arial";
        ctx.fillText(text, this.x + this.width / 2, this.y + this.height + 16 + infoBoxH / 3.6);
    }

    private drawRadiusHandles(ctx: CanvasRenderingContext2D) {
        const handleCoordinate = ("NW", "NE", "SW", "SE") as PolarCoordinate();
        if(this.type === 'RECTANGLE' && this.width >= 50 && this.height >= 50) {
            this.radiusHandles = ();
            handleCoordinate.forEach((polarPosition, index) => {
                this.radiusHandles = (...this.radiusHandles!, new RadiusHandle(polarPosition, {x: this.x, y: this.y}, this.width, this.height, ctx, this.radius!(index)))
            });
        }
    }

    public mouseIsOver(e: MouseEvent, offsetX: number, offsetY: number) {
        const mouseX = e.clientX - offsetX;
        const mouseY = e.clientY - offsetY;

        if(this.type === 'CIRCLE') {
            return mouseIsInsideEllipse(mouseX, mouseY, offsetX, offsetY, this.x, this.y, this.height, this.width);
        }

        if(this.type === 'RECTANGLE') {
            return mouseIsInsideRectangle(mouseX, mouseY, offsetX, offsetY, this.x, this.y, this.height, this.width);
        }

        if(this.type === 'LINE') { 
          
            return (
                mouseX < this.endX && mouseX > this.x &&
                mouseY > this.y - 5 && mouseY < this.endY + 5
            )
        }
    }

    public get isSelected(): boolean {
        return this._isSelected;
    }

    public set isSelected(value: boolean) {
        this._isSelected = value;
    }

    public get isMoving(): boolean {
        return this._isMoving;
    }

    public set isMoving(value: boolean) {
        this._isMoving = value;
    }

    public drawShape(ctx: CanvasRenderingContext2D) {
        ctx.save();
        const horisontalCenter = this.x + ( this.width / 2);
        const verticalCenter = this.y + (this.height / 2);

        ctx.translate(horisontalCenter, verticalCenter);
        ctx.rotate(degreesToRadians(this.rotation));
        ctx.translate(- horisontalCenter, - verticalCenter);

        if(this.shadow) {
            this.applyShadow(ctx);
        }

        if(this.radius) {
            const radiuses = this.radius.map( x => this.height/2 > x && this.width/2 > x);
            radiuses?.forEach( (r, i) => {
                if(!r) {
                    this.radius!(i) = (this.height / 2);
                }
            })
        }

        switch(this.type) {
            case 'RECTANGLE':
                this.drawRectangle(ctx);
                break;
            case 'CIRCLE':
                this.drawCircle(ctx)
                break;
            case 'LINE':
                this.drawLine(ctx)
                break;
        }
    }

    public drawCircle(ctx: CanvasRenderingContext2D) {
        ctx.beginPath();

        if(this.fill) {
            ctx.fillStyle = this.fill;
            ctx.ellipse(this.x + this.width/2, this.y + this.height/2, this.width/2, this.height/2, 0, 0, 2*Math.PI);
            ctx.fill();
        }

        if(this.stroke) {
            ctx.setLineDash(());
            ctx.strokeStyle = this.stroke.style;
            ctx.lineWidth = this.stroke.width;
            ctx.ellipse(this.x + this.width/2, this.y + this.height/2, this.width/2, this.height/2, 0, 0, 2*Math.PI);
            ctx.stroke();
        }

        ctx.restore();

        if(this.isSelected) {
            this.drawResizeHandles(ctx);
        }
        ctx.closePath();
    }

    public drawRectangle(ctx: CanvasRenderingContext2D) {
        if(this.fill) {
            ctx.fillStyle = this.fill;
            this.roundedRectangle(ctx, this.x, this.y, this.width, this.height, this.radius || (0,0,0,0));
            ctx.fill();
        }

        if(this.fill && !this.radius) {
            ctx.fillStyle = this.fill;
            ctx.fillRect(this.x, this.y, this.width, this.height);
        }
        
        if(this.stroke) {
            ctx.setLineDash(());
            ctx.strokeStyle = this.stroke.style;
            ctx.lineWidth = this.stroke.width;
            this.roundedRectangle(ctx, this.x, this.y, this.width, this.height, this.radius || (0,0,0,0));
            ctx.stroke();
        }

        ctx.restore();

        if(this.isSelected) {
            this.drawResizeHandles(ctx);
            this.drawRadiusHandles(ctx);
        }
    }

    public drawLine(ctx: CanvasRenderingContext2D) {
        ctx.beginPath();
        ctx.setLineDash(());
        ctx.strokeStyle = 'black';
        ctx.moveTo(this.x, this.y);
        ctx.lineTo(this.endX, this.endY);
        ctx.stroke()
        ctx.closePath();
        ctx.restore();

        if(this.isSelected) {
            this.drawLineResizeHandles(ctx);
        }
    }

    public mouseIsOverRadiusHandle(mouseX: number, mouseY: number) {
        if(this.type === 'RECTANGLE') {
            return this.radiusHandles?.find(x => x.mouseIsOver(mouseX, mouseY))?.position || null;
        }
    }

    public mouseIsOverResizeHandle(mouseX: number, mouseY: number) {
        return this.resizeHandles.find(x => x.mouseIsOver(mouseX, mouseY))?.position || null;
    }

}

What could I improve and how should I structure it?

How would you approach adding features and focusing on each one?

What am I doing wrong and what would be a better alternative?

Is the performance of my app ok, or there are ways to improve it?

Are there alternative techniques for resizing shapes and detecting mouse over?

Here is a working example of the code from the repository above: the drawing app

html – Semantic Elements and Text Formatting in HTML5

Intro:

Almost, every website, book, article, newspaper, etc… that contains copyrights, caveat, disclaimers, etc… displays it in small font text.

Now… I’m doing a research about Semantic Elements and Text Formatting in HTML5, and we know that we should use <strong></strong> instead of <b></b>, for example, if we’re not just styling the content to display bold text, it’s about how important is the text, because at the end of the day, HTML elements present the “data” that it includes, and if we just want to give the text an attention, we should avoid using <b></b> and use <span></span> and style it in CSS, because that’s the usage of CSS… styling…

Since small element is semantic, it leads us to the question:

The Question:

Why the font of these information are displayed, usually, in small size?
(The answer will help understanding why small is a semantic element)

html5 – Como criar um :hover para quando passar em cima da minha imagem ela se destacar

Bom to fazendo um projeto muito simples de um player.mp3 cujo objetivo é me familiarizar com o html/css e como é de se esperar tenho algumas duvidas que para alguns é algo bem simples, tenho algumas perguntas referentes a utilização dos “cards” do framework Materialize e tambem da utilização correta do :hover em identificadores e classes no css.

Uma observação é que algumas coisas nesse codigo pode não fazer sentido… mais como ja disse to usando para aprender os limtes do html/css e entender na pratica como as tags e elementos funcionam.

CODIGOS

@import "https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css";
@import "https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css";

body {
    background: linear-gradient(rgb(29, 129, 143),rgb(128, 27, 148));
    display: flex;
    align-items: center;
    justify-content : center;
    font-family: 'Ubuntu', sans-serif;     
}
.card-image {
    box-shadow: 0px 0px 10px 7px;
}
div .card-image :hover{
    transition: 1s;
    background: blueviolet;
    box-shadow: 0px 0px 10px 10px;
}
.card {
    box-shadow: 0px 0px 10px 7px;
    width: 100%;
   position: relative ;
   background: linear-gradient( #888888 60%,#a39e97 100%) ;
   border-radius: 10px;
}
.card-content {
    box-shadow: 0px 0px 10px 7px  
}
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://pt.stackoverflow.com/reset.css">
    <link rel="stylesheet" href="style.css">
    <title>mp3.player/beta</title>
</head>
<body>
<main>
<div id="caixa-mestre" class="card">
    <h5><i class ="material-icons">blur_on</i>SafeZØNE</h5>
    <div id="caixa-img" class="card-image"><img src="Img/Img.jpg" alt="capa"></div>
    <div class="card-content">
    <audio controls src="Music/Linkinpark.mp3"></audio>
    <h5>Title</h5>
    <p>Artist</p>
</div>
</div>
</main>
</body>
</html>

PRÉ-VISUALIZAÇÃO
inserir a descrição da imagem aqui

Gostaria de principalmente organizar meus identificadores e como eu posso ter 2 .card sendo que ja são um grupo eu posso colocar identificadores em grupos para diferenciar individualmente e se eu posso como posso fazer isso?

De qualquer forma aceito dicas e em relação ao meu codigo um comentario desde já obrigado 🙂 .

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies 5000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Buy Cheap Private Proxies; Best Quality USA Private Proxies