Media is too big
VIEW IN TELEGRAM
⚛Video<1>: HTML
⚛Subject: Basics of HTML Tags, Attributes, and Elements.
⚛Source: Udemy
⚛Quality: High
🕛Duration: 4:05
⚛Subject: Basics of HTML Tags, Attributes, and Elements.
⚛Source: Udemy
⚛Quality: High
🕛Duration: 4:05
👍5❤3
Nested HTML Elements
⚛HTML elements can be nested (this means that elements can contain other elements).
⚛All HTML documents consist of nested HTML elements.
⚛The following example contains four HTML elements (<html>, <body>, <h1> and <p>):⬇️
⚛HTML elements can be nested (this means that elements can contain other elements).
⚛All HTML documents consist of nested HTML elements.
⚛The following example contains four HTML elements (<html>, <body>, <h1> and <p>):⬇️
👍2
⚠️-Note: Some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag!
👍2
⚠️-Never Skip the End Tag
Some HTML elements will display correctly, even if you forget the end tag.
Some HTML elements will display correctly, even if you forget the end tag.
⚛The <body> element defines the document's body.
⚛It has a start tag <body> and an end tag </body>.
Then, inside the <body> element there are two other elements: <h1> and <p>:
⚛It has a start tag <body> and an end tag </body>.
Then, inside the <body> element there are two other elements: <h1> and <p>:
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
..................................................⬇️
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
..................................................⬇️
👍1
Example Explained
⚛The <html> element is the root element and it defines the whole HTML document.
⚛It has a start tag <html> and an end tag </html>.
⚛Then, inside the <html> element there is a <body> element:
⚛The <html> element is the root element and it defines the whole HTML document.
⚛It has a start tag <html> and an end tag </html>.
⚛Then, inside the <html> element there is a <body> element:
👍2
⚠️-However, never rely on this! Unexpected results and errors may occur if you forget the end tag!
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
..................................................⬇️
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
..................................................⬇️
👍3
⚠️-HTML Elements
An HTML element is defined by a start tag, some content, and an end tag.
An HTML element is defined by a start tag, some content, and an end tag.
⚛HTML Elements
The HTML element is everything from the start tag to the end tag:
<tagname>Content goes here...</tagname>
Examples of some HTML elements:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
The HTML element is everything from the start tag to the end tag:
<tagname>Content goes here...</tagname>
Examples of some HTML elements:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
❤1
<p>This is a <br> paragraph with a line break.</p>
❤1
⚠️-HTML is Not Case Sensitive
HTML tags are not case sensitive: <P> means the same as <p>.
HTML tags are not case sensitive: <P> means the same as <p>.
👍2❤1
Empty HTML Elements
⚛HTML elements with no content are called empty elements.
⚛The <br> tag defines a line break, and is an empty element without a closing tag:⬇️
⚛HTML elements with no content are called empty elements.
⚛The <br> tag defines a line break, and is an empty element without a closing tag:⬇️
👍5❤1
This media is not supported in your browser
VIEW IN TELEGRAM
⭐️CSS Tip!⭐️
To create an inverted :hover effect, you can use mix-blend-mode with custom :hover properties.
The cool thing is that using mix-blend-mode acts as a color inverter, which works well with monochrome controls.
As for how to move this code to JavaScript?
To create an inverted :hover effect, you can use mix-blend-mode with custom :hover properties.
button > span {
left: calc(var(--x, 0) * 1px);
top: calc(var(--y, 0) * 1px);
mix-blend-mode: difference;
}The cool thing is that using mix-blend-mode acts as a color inverter, which works well with monochrome controls.
As for how to move this code to JavaScript?
const UPDATE = ({target, x, y }) => {
const bounds = target.getBoundingClientRect()
target .style.setProperty('--x', x - bounds.left)
target .style.setProperty('--y', y - bounds .top)
}
const BTNS = document.querySelectorAll('button')
BTNS.forEach(BTN => BTN.addEventListener('pointermove', UPDATE))button:is(:hover, :focus-visible) {
--active: 1;
}
button span {
transform: translate(-50%, -50%) scale(calc(var(--active, 0) * 3);
transition: transform 0.25s;
}👍10❤2🔥2
GitHub Copilot is now Free for VS Code!!
🥰9❤6👍6