Hi, I'm Raza Abbas, a passionate front-end developer with a strong foundation in building engaging and responsive web applications. In the ever-evolving world of web development, I am enthusiastic about creating seamless user experiences through efficient code. Follow on GitHub
I’m currently learning...Typescript
Latest solutions
Rest Countries API ,Vite, React and tailwind css , with theme switch
#react#react-router#tailwind-css#axiosSubmitted over 1 year agoResponsive space multipage web, using vite +react +tailwind +carousel
#react#tailwind-css#viteSubmitted over 1 year agoResponsive landing page with vite, react and tailwind css
#react#tailwind-css#viteSubmitted over 1 year ago
Latest comments
- @abimh66@RazaAbbas62
Hi, it looks good, but without the repo URL, I couldn't check your code.
One suggestion is to handle cases where a country has no information like borders or other details, and display suitable information in those cases. For example, Antarctica doesn't have such detailed information, and the page shows a loading spinner. I had a similar issue with mine but realized that later
Enjoy coding :)
- @tloxiu@RazaAbbas62
Hi, @tloxiu in your
question p
in CSS you can usetransition: height 0.3s linear;
it would make a smooth transition between hiding and showing your answer
I hope it would help
Enjoy coding :)
Marked as helpful - @FranckBigand@RazaAbbas62
To achieve the desired behavior of fixing the footer at the bottom of the page and allowing it to be visible when the content is smaller than the screen height or requiring scrolling when the content is larger, you can use a combination of HTML and CSS. Here's an example:
HTML structure:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <title>Your Page Title</title> </head> <body> <div class="wrapper"> <!-- Your page content goes here --> <div class="content"> <!-- Your actual content --> </div> </div> <footer> <!-- Your footer content goes here --> </footer> </body> </html>
CSS styles (styles.css):
body { margin: 0; padding: 0; min-height: 100vh; display: flex; flex-direction: column; } .wrapper { flex: 1; } footer { background-color: #f0f0f0; padding: 10px; position: sticky; bottom: 0; width: 100%; }
Explanation:
-
The
body
element is set todisplay: flex
andflex-direction: column
to ensure that the main container (wrapper
) takes up the available vertical space. -
The
wrapper
div is givenflex: 1
to take up the remaining space and allow the footer to be pushed to the bottom. -
The
footer
is set toposition: sticky
andbottom: 0
to make it stick to the bottom of the page. It will remain at the bottom even if the content is smaller than the screen height. -
The
min-height: 100vh
on thebody
ensures that the body takes at least the full height of the viewport.
With this setup, the footer will be fixed at the bottom of the page for small content and will be visible without scrolling. For larger content, you will need to scroll to see the footer. Adjust the styles according to your design preferences.
-
- @rising-dancho@RazaAbbas62
You can use
display: flex; flex-direction: column; gap: 20px; It would create the desired effect
Marked as helpful - @Nrotsa@RazaAbbas62
There are two ways to achieve that behavior
/* Regular cursor color */ body { cursor: default; } /* Change cursor color on hover */ body:hover { cursor: url('path/to/black-cursor.png'), auto; }
Or if u don't have that black cursor image you can do like
/* Change cursor color on hover to solid black */ body:hover { cursor: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAf0lEQVR42mP8/wc/AwAB/ABsAAdUoJ9QAAAABJRU5ErkJggg=='), auto; }
Marked as helpful - @AngwenyiOgata@RazaAbbas62
To use custom fonts:
-
Include Font Files:
- Place your font files in a folder (e.g., "fonts") within your project.
-
Define Font Face in CSS:
@font-face { font-family: 'YourFontName'; src: url('path/fonts/your-font-file.woff2') format('woff2'), url('path/fonts/your-font-file.woff') format('woff'); }
Replace
'YourFontName'
with the desired font family name, and update the file paths based on your project structure. -
Apply the Font in CSS:
body { font-family: 'YourFontName', sans-serif; }
Use the specified font family in the
font-family
property. If the custom font is unavailable, the browser will use a generic sans-serif font as a fallback.
I hope it will help.
Happy Coding :)
Marked as helpful -