@pablohimself
Submitted
How can I improve my CSS?
Looking to hire developers?
@kacperkwinta
@pablohimself
Submitted
How can I improve my CSS?
@kacperkwinta
Posted
To improve your code, you can consider the following suggestions:
1.Optimize your images:
<img>
tags or use the CSS aspect-ratio
property to reserve space on the page before the image loads.2.Avoid CSS @import
:
@import
to include CSS files within others, use multiple <link>
tags within HTML to load CSS files in parallel. This improves efficiency and loads CSS files faster. Source 33.Preload CSS files:
<link>
tag with the preload
attribute to start downloading CSS files immediately instead of waiting for them to be referenced in the HTML.4.Use critical inline CSS:
tag in the <head>
section of your HTML.5.Use media query rendering:
6.Use @font-face to import fonts:
@font-face
rule in your CSS to import the fonts and specify the font-family.By implementing these optimizations, you can improve the performance and efficiency of your code.
@Uvejsii
Submitted
All feedback is welcome thank you in advance.
@kacperkwinta
Posted
Some tips:
1.Use a consistent naming convention: Choose a naming convention for classes, IDs, and variables that is consistent throughout your codebase. For example, you can use hyphenated class names instead of camel case or underscores. This improves readability and maintainability.
2.Use descriptive class names: Instead of using generic class names like "container", "image", and "text", consider using more descriptive class names that convey the purpose or meaning of the element. This makes it easier for other developers to understand your code and helps in future updates.
3.Organize your CSS properties: It's a good practice to organize your CSS properties in a consistent and logical order. For example, you can group related properties together such as layout properties (e.g., display, position), box model properties (e.g., padding, margin), and typography properties (e.g., font-size, color). This makes it easier to scan and understand your code.
4.Optimize your CSS code: There are several techniques you can use to optimize your CSS code:
padding-top: 10px; padding-right: 20px; padding-bottom: 10px; padding-left: 20px;
, you can use padding: 10px 20px;
. This reduces the amount of code and improves performance.5.Consider using a CSS framework: If you find yourself writing a lot of repetitive CSS code, you might consider using a CSS framework like Bootstrap or Tailwind CSS. These frameworks provide pre-built components and utility classes that can speed up development and ensure consistency across your project.
In addition to these tips, here are some additional resources that can help you improve your CSS code:
Marked as helpful
@biggsk81
Submitted
Hi, This was my first attempt at a project on Frontend Mentor. The css stuff has been a little difficult for me, sizing the different elements like the image and the container it is in still learning. Any input/feedback or tips is welcome. Thank you.
@kacperkwinta
Posted
To improve your code and properly size the different elements, you can use the following techniques and best practices:
max-width
and max-height
properties to make it responsive while maintaining its aspect ratio. This will ensure that the image scales down properly on smaller screens without distorting.vw
and vh
to size elements relative to the viewport size. For example, you can set the height of the container to 80vh
to make it take up 80% of the viewport height.box-sizing
property:box-sizing
property is set to content-box
, which means that the width and height of an element are calculated based on its content, padding, and border. This can sometimes lead to unexpected sizing behavior.box-sizing
property to border-box
. This means that the width and height of an element include its content, padding, and border. This can help ensure that the specified dimensions are applied consistently across different elements.px
, em
, rem
, or even vw
for responsive text sizing.Sources:
Marked as helpful
@LoaiEsam37
Submitted
Any suggestions on how I can improve and reduce unnecessary code are welcome!
Thank you. šāļø
@kacperkwinta
Posted
Hi, I recommend to not using the same name on every challenge
@KombatM3dik
Submitted
Very first project. Still got a lot of learning left
@kacperkwinta
Posted
Hi! š
I really like your project!
Here I have some tips to make your solution even better:
QR code box should be centered, you can learn how to do this by watching this YT short š¬here
As you can see in your Report section it's really important to have at least one <h1>
tag on a page
Instead of many divs, try to use some semantic meaning elements
Keep learning and have a good day ā
@arnihilator
Submitted
Nothing special, but you need to start somewhere, eh? :)
@kacperkwinta
Posted
Hi! š
Great job, really!
To make your solution even better, you can add box-shadow
to this QR code box, I prefer to use this site and just copy one. If you want to avoid some errors you can read in Accessibility report table, always use main
, section
, footer
etc. for grabbing your divs, it's important for accessibility. It's also a good practice to have at least one h1
on page š
Keep going and happy coding šā
@aimal-qazi
Submitted
I hope you guys like my work...
@kacperkwinta
Posted
Good job Qazi šš
Keep up work!
Some tips to make your solution even better:
<div>
elements and other important stuff, it's good practice to use semantic meaning elements like <section>
, <article>
, <main>
, <footer>
etc...There are also other not much important differences, look closer at design and try your best to make your solution similar ā
Marked as helpful
@marianojugo
Submitted
This is my solution to this challenge, any feedback is welcome.
@kacperkwinta
Posted
Hi! Looks great!
Some tips:
Marked as helpful
@ellenearteleg
Submitted
This was by far the most enjoyable challenge I have taken on. It's my first time to use grid and it gives me so much joy that such tool exist, the flexibility and possibilities are basically limitless.
I would love for you guys to take a look at my solution and let me know what you think. Any feedback will be much appreciated.
@kacperkwinta
Posted
Hi! Looks great on mobile, desktop version is nice too. The background color in the design is not white, look there for right color :), and border thickness in buttons hover is more than 1px
Marked as helpful
@Ganesh-Rathor
Submitted
everything is fine in this airticle component only challange that stuck me is responsive layout.
@kacperkwinta
Posted
Yeah, try to avoid div
, use semantic tags like section
, footer
, main
. For <div class="attribution">
you should use <footer>
Here article about changing svg colors
Marked as helpful
@Nickil13
Submitted
Looking for any tips on approximating font sizes and how to add spacing around the text to get closer to the design images!
@kacperkwinta
Posted
Some tips:
@felonta
Submitted
@kacperkwinta
Posted
Zoom out and see how entire box is looking, that's because you use vh
, try to code this in another way
Marked as helpful
@LuanFlorencioo
Submitted
@kacperkwinta
Posted
Very nice animations!
Marked as helpful
@SoftwareRebelss
Submitted
I have difficulties with centering cards. For left and right sections I use margin: 0 auto; my question is, what to use for the top and bottom sections.
@kacperkwinta
Posted
Some tips:
Marked as helpful
@AbdulrahmanFE
Submitted
Any feedback that's will improve my code <3.
@kacperkwinta
Posted
Looks really good! All I would change is the box-shadow
property, in design was a little bit more subtle
@AbdulrahmanFE
Submitted
Any feedback that's will improve my code <3.
@kacperkwinta
Posted
Very responsive and good-looking (:
@leorichy
Submitted
Reviews are welcome !
š
@kacperkwinta
Posted
@artemis-tiwa
Submitted
@kacperkwinta
Posted
Some tips:
<main>
tag and wrap all other into this (semantic and accessibility), more about this hereMarked as helpful
@Infect3d
Submitted
I'm so proud that I have managed to almost finish this challenge all by myself. There is one problem that I can't solve. I can't make the "view" icon popup at the same time with color overlay. Will You be so kind to check my messy code and help me? ;)
@kacperkwinta
Posted
Some tips:
<main>
tag and wrap all other into this (semantic and accessibility), more about this hereMarked as helpful
@K0smic
Submitted
I finished the calculator, trying to stay as faithful to the design as possible.
I'm always looking for tips for code, readability, and optimization. A look at the code is very welcome.
@kacperkwinta
Posted
Looks excellent! Pixel perfect šÆ
@zeerobit
Submitted
First time using scss i hope i made good use of it for this challenge. Please provide feedback if any change is needed
@kacperkwinta
Posted
Looks nice (:
Some tips:
@clairesersun
Submitted
I'm curious if using the dialog element is the best element to wrap the main content for this challenge.
@kacperkwinta
Posted
Wow, this is the first time I see a <dialog>
tag! I think there is no need to use this tag, you can use a simple div
Some tips:
px
for font-size
, here's whybox-shadow
to the box, as you can see in the design@djordain21
Submitted
send help pls :')
@kacperkwinta
Posted
Some tips š»:
<main>
tag and wrap all other into this (semantic and accessibility), more about this [here]pt
for font-size
, instead of this use rem
, here's why<html>
element must have a lang attribute<title>
element to aid in navigation<!DOCTYPE html>
Marked as helpful
@AceDub
Submitted
Would appreciate any feedback on anything I can improve on, thank you!
@kacperkwinta
Posted
Looks awesome! Pixel-perfect (:
Marked as helpful