@tejasva-087
Submitted
Just got stuck in media queries and shadows. I am a bit confused in media queries that somehow worked but i dont know how?
@Toheeb345
@tejasva-087
Submitted
Just got stuck in media queries and shadows. I am a bit confused in media queries that somehow worked but i dont know how?
@Toheeb345
Posted
Hello,
you are actually styling desktop first, so you will need to set your max-width
for the tablet size but you are indicating the maximum width to be the the size of mobile screen, you can change the max-width for your media query to this:
@media (max-width: 768px) {
}
it is meant to work that way π
@IsaacLezama
Submitted
I'd like some help with centering divs, I found kind of easy with the horizontal centering but it was difficult when I tried vertical. Any advice or comment about what I did would be really appreciated. Also sorry for my english in advanced, it's not my first language (:
@Toheeb345
Posted
you were using transform
transform: translate(-50%, 10%);
The correct way to center a div using the positioning property is
transform: translate(-50%, -50%); β
Try it out!!
@faybas
Submitted
Thanks for all responses
@Toheeb345
Posted
An easy way you can do this is by giving an ID of the exact number for each of the buttons in the html file, then you store the ID in a variable to get the ID of the button clicked, and then you output the variable in the result part
Example:
<button id="1" class="rate">1<button >
<button class="btn">submit<button >
const btn = document.queryselector('.btn');
const rate= document.queryselector('.rate');
btn.addEventListener("click", ( ) => {
const rateValue = rate.id;
result.innerHTML = ${rateValue}
;
});
That's just a demo code to show you what i was talking about, let me know if you got it!