Latest solutions
Latest comments
- @PaulPabilonia@nmorajda
-
Use correct indentation in the HTML code
-
Reset default CSS styles for browser (now you have default margin / padding).
-
Change
.container { height: 100%; }
on
.container { min-height: 100vh; }
and remove the padding, and you will have the element centered vertically as well.
Marked as helpful -
- @ThanhVuong0904@nmorajda
Links don't work, I guess that's why:
function getData(callback) { const API = "http://localhost:3000/tracking"; ...
and correct the errors visible in the report at the top.
Happy codding :)
- @ThanhVuong0904@nmorajda
if(clickIndex === "weekly") { timeFramesCurrent = timeframes.weekly.current; timeFremesPre = timeframes.weekly.previous; } else if (clickIndex === "daily") { timeFramesCurrent = timeframes.daily.current; timeFremesPre = timeframes.daily.previous; } else if (clickIndex === "monthly") { timeFramesCurrent = timeframes.monthly.current; timeFremesPre = timeframes.monthly.previous; }
can probably be written shorter and just as legible:
const timeFramesCurrent = timeframes[clickIndex].current; const timeFremesPre = timeframes[clickIndex].previous;
or maybe:
const {current, previous} = timeframes[clickIndex]
in the second case you have to rename the variables later in the code or
const {current: timeFramesCurrent, previous: timeFremesPre} = timeframes[clickIndex]
Marked as helpful - @AmazingCukr@nmorajda
Look fine on the desktop, but there are some small bugs in the code:
<div class="Header"> ...
Don't use uppercase letters at the beginning of the class name, id, etc.
<div class="text"> ...
This div element does nothing.
Why not:
<p class="text"> ....
?
It is also not responsive and from a width of 400px a horizontal scroll bar starts to appear.
You also have three errors in the report above.
- @JSegundo@nmorajda
It looks good ... but only on the desktop.
It is not responsive.
Use a media query for this purpose.
Do not specify the height in px (usually the height of the element is to result from its content or the height of the parent element).
If you use the section element, there should be some header inside. In this case, the IMHO section element is replaceable with a div element.
Marked as helpful - @anisgo@nmorajda
The height of an element should rather result from its content, and not be fixed:
height: 80vh;
Use the min-height property if you must, but you don't have to.
Marked as helpful