27
loading...
This website collects cookies to deliver better user experience
<img src="link-to-image">
<!-- Responsive images -->
<img
srcSet="link-to-img 480w, link-to-img@2x 720w, link-to-img@3x 960w"
sizes="(max-width: 1200px) 480px, (max-width: 2560px) 720px, 960px"
src="imgUrl@3x"
>
<!-- Art Direction -->
<picture>
<source media="(max-width: 1200px)" srcSet="link-to-img">
<source media="(max-width: 2560px)" srcSet="link-to-img@2x">
<source media="(min-width: 2560px)" srcSet="link-to-imgl@3x">
<img src="link-to-img@3x">
</picture>
create-react-app
), but since vanilla React is computed on Client-side, it hampers both Performance and SEO. Re-writing the entire website in Next.js provided some serious improvement to the Lighthouse Score.import React, { lazy, Suspense } from 'react';
const LazyComponent = lazy(() => import('./LazyComponent'));
function Component() {
return (
<div>
<Suspense
// fallback will be displayed while the lazy component loads
fallback={<div>Loading...</div>}
>
<LazyComponent />
</Suspense>
</div>
);
}
css-minimizer-webpack-plugin
.const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
optimization: {
minimizer: [
new CssMinimizerPlugin(),
],
},
};
alt
: The alt
attribute is the HTML attribute used in HTML documents to specify alternative text that is to be rendered when the element (generally images) to which it is applied cannot be rendered.
<img src="link-to-img" alt="image-description">
aria-label
: The aria-label
attribute is used to define a string that labels the current element. Use it in cases where a text label is not visible on the screen.
<button aria-label="Close" onclick="dialog.close()">
X
</button>
aria-labelledby
: Similar to the aria-label
attribute, but it should be used if there is visible text labeling the element.
<div role="dialog" aria-labelledby="dialog-header">
<h2 id="dialog-header">Choose a File</h2>
<!-- ... Dialog contents -->
</div>
I am a beginner, how should I learn Front-End Web Dev?
Look into the following articles:
Would you mentor me?
Sorry, I am already under a lot of workload and would not have the time to mentor anyone.
Would you like to collaborate on our site?
As mentioned in the previous question, I am in a time crunch, so I would have to pass on such opportunities.