How do you center your div perfectly?
Danilo Arcidiacono
@daniloarcidiaconoAll comments
- @JonathanthedeveloperSubmitted over 2 years ago@daniloarcidiaconoPosted over 2 years ago
If you have only a single tag inside body, you can try to use flexbox:
html, body { height: 100%; } body { display: flex; justify-content: center; align-items: center; }
0 - @sahalakmaSubmitted over 2 years ago
Building Chart according to the given model is a little bit difficult. but after knowing about chart js and it's features it became easier process.
The Next Challenge was to connect the given JSON data with our bar chart. after some research i find out what is the problem and got the solution.
The only problem I am Facing now is to Edit the Tooltip Label of Bar Chart. I want to add an Extra "$" sign before the amount in tooltip, But I Can't do that. If anyone know about that Please give me solution❤️
@daniloarcidiaconoPosted over 2 years agoYou can try the before selector like this:
<your-selector>::before { content: "$"; }
0 - @GregW1994Submitted over 2 years ago
Any ideas how to better position "Annual Plan $59.99/year" so it moves a bit to the left? I used margin-right, but it doesn't look good on small screens .
@daniloarcidiaconoPosted over 2 years agoHello, I would start by adding this:
.shopping-item-details { ... flex: 1 1 auto; }
which is a short form for:
.shopping-item-details { ... flex-grow: 1; flex-shrink: 1; flex-basis: auto; }
That makes the 'Annual Plan' grow and take the available space.
Finally, add the following:
.shopping-item { .... gap: 1rem; }
gap
adds a margin between flex items.Marked as helpful0 - @LucianoDLimaSubmitted over 2 years ago
I have no idea how to replicate the overlay color on top of the black and white image provided
@daniloarcidiaconoPosted over 2 years agoDidn't try this challenge yet, but I can think of two ways to tint the image with CSS:
-
Using a suitable combination of filters (see https://codepen.io/sosuke/pen/Pjoqqp);
-
Applying an overlay (with position absolute/relative) with a semi-transparent background color;
0 -
- @ykru6Submitted over 2 years ago
How organize and clean my code was? Is my code a clutter, or inefficient? What could I've done better next time? What should I acknowledge in order to up my skills in CSS?
By the way, if the Web URL has problem then it's my bad, because this is my first time use Github. And this is my 2nd attempt at upload this solution, since the web crashed somehow...
@daniloarcidiaconoPosted over 2 years agoHello, here are some things that come to mind:
-
Use BEM notation consistently to name your CSS classes (block__element--modifier);
-
The font is imported in HTML but it's not used in CSS;
-
Do not select h1, h4, p tags directly. Either add a class to such tags or use a CSS combinator to target them;
-
Use max-width for the card. Also don't set a fixed height.
-
Use CSS custom properties to centralize constants, like colors;
-
Put your CSS files in a dedicated folder;
0 -