Latest solutions
fep: responsive, semantic, css grid, sass, custom props
#accessibility#sass/scssSubmitted over 1 year agoCSS only, Tailwind CSS, Responsive (240+), Columns, Flexbox, Grid…
#accessibility#animation#tailwind-cssSubmitted over 1 year agoAge Calculator app (Responsive, TS, Sass, WAI-ARIA)
#accessibility#typescript#sass/scssSubmitted over 1 year agoInteractive rating component (Vanilla JS)
#accessibility#fetch#sass/scss#lighthouseSubmitted over 1 year ago(rem Perfect + a bit of trigonometry) Skilled e-learning landing page
#accessibility#sass/scss#lighthouseSubmitted over 1 year ago(rem Perfect, errors accessibility) Pod request access landing page
#accessibility#sass/scss#lighthouseSubmitted over 1 year ago
Latest comments
- @anar-solSubmitted over 1 year ago@HA3IKPosted over 1 year ago
About the “list”: I think that this is not a semantically correct solution.
Even if the
H2
outline, at the current position, extends to the entireSECTION
correct. I don't see the point of making the title, in the markup, a list item.H2
should be just a heading for theUL
, not an item of it.SECTION > H2 + UL > LI*5
I also saw that you have a duplicate ID
linearGradient#a
. You can easily fix this by simply declaring a genericSVG[height=0]
somewhere separately on the page, it should work:<svg height="0"> <defs> <linearGradient id="a"> ... </linearGradient> </defs> </svg>
0 - @anar-solSubmitted over 1 year ago@HA3IKPosted over 1 year ago
Hello, About “hero-image”.
But 1st: it's a very nice effect u got 👍 I'd leave it 😅
If you want to control this image within its position, you just need to disable its
absolut
position (make itposition:static
) THEN or changeobject-fit
to "contain", or addoverflow:visible
.IF you plan to center everything in one column (like on the mob.):
.hero__body { margin:0 auto }
ELSE IF you want to keep
.hero__body
andpicture
horizontally, just make the parent element Flexbox.hero__container { display:flex }
0 - @stac4uoSubmitted over 1 year ago@HA3IKPosted over 1 year ago
You don't need to listen to the same event on the same element for each function (DRY). You can call an anonymous function for all the functions you need:
button.addEventListener("click", e => { newYear(); newMonths(); newDays(); });
Marked as helpful0 - @stac4uoSubmitted over 1 year ago@HA3IKPosted over 1 year ago
Hello,
A few recommendations for your JS code.
- To insert simple text do not use
innerHTML
, for this task useInnerText
ortextContent
. - No need to create
hidden
class, use[hidden]
attribute. - DRY (Don't repeat yourself) - You have large chunks of repetitive code. Lines 21-24 and 26-29, 46-49 and 51-54, 69-73 and 75-77,79 are absolutely identical. In this case, it is necessary to create functions that will perform the same task, and pass references to input, output, error, etc. tags as arguments:
const showError = (label, input, output, msg) => { msg.hidden = true; // instead of: msg.classList.remove("hidden"); label.classList.replace("text-SmokeyGrey", "text-LightRed"); input.classList.replace("border-LightGrey", "border-LightRed"); output.textContent = "--"; // instead of: output.innerHTML = "--"; } // showError(yearsText, inputYear, years, errorMsg3); // showError(monthText, inputMonth, months, errorMsg2); // showError(dayText, inputDay, days, errorMsg1);
The same for
hideError()
Marked as helpful0 - To insert simple text do not use
- @GIR0SANSubmitted over 1 year ago@HA3IKPosted over 1 year ago
Hello.You are using the HEADER tag incorrectly.
Semantically correct, if you wrap the main content in the MAIN tag.
And you can use FIGURE + FIGCAPTION for the card (picture + description).
Marked as helpful0 - @amalhanajaSubmitted almost 2 years ago@HA3IKPosted almost 2 years ago
Also,
SECTION
is tag of "Sectioning Content" category - creates a section that defines the scope of the heading (H1-6) content. That is, semantically,MAIN
data (withFIGURE
) is outside the context ofH1
.Marked as helpful0