I'm new to Tailwind and my setup works on Firefox, but not with Google Chrome. Is there some sort of webkit issue that I might be missing? I have tested my code on various versions. Weirdly with dev tools it does work on Chrome. However the deploy doesn't work on Google or Android phone. All styles are applied except the resizing elements, so my phone just displays a monitor webpage.
function Header() {
return (
<>
<section
id='hero'
className='px-4 py-8 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8'
>
<div className='flex flex-col items-center justify-between w-full mb-10 lg:flex-row'>
<div className='mb-16 lg:mb-0 lg:max-w-lg lg:pr-5 lg:pl-5'>
<article className='max-w-xl mb-6'>
<div>
<h4 className='inline-block font-semibold tracking-wider uppercase text-eco-green rounded-full'>
Brand new web project
</h4>
</div>
<h1 className='text-eco-green font-extrabold text-6xl pb-6 md:py-4 text-center md:text-left'>
myecoapp
</h1>
<h2 className='font-sans text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl sm:leading-none max-w-lg mb-6'>
Help The Planet <br className='hidden md:block' />
by existing{' '}
<span className='inline-block text-deep-purple-accent-400'>
and clicking
</span>
</h2>
<p className='text-gray-700 text-base md:text-lg'>
Help the environment from anywhere for free! At home or at any
event. Use our apps to earn while you relax. We have done what
we can to provide entertainment for you. Check it out below.
</p>
</article>
<div className='flex items-center space-x-3'>
<CTA />
</div>
</div>
{/* Phones */}
<div className='flex h-full items-center justify-center lg:w-1/2'>
<div className='w-2/5'>
<img
className='object-cover'
src='https://kitwind.io/assets/kometa/one-girl-phone.png'
alt=''
/>
</div>
<div className='w-5/12 -ml-16 lg:-ml-32'>
<img
className='object-cover'
src='https://kitwind.io/assets/kometa/two-girls-phone.png'
alt=''
/>
</div>
</div>
</div>
</section>
</>
)}
Related
I have a Vue3 carousel inside a Single file component
package.json
"vue3-carousel": "^0.1.40"
SFC
import { Carousel, Slide, Navigation } from 'vue3-carousel';
import 'vue3-carousel/dist/carousel.css';
import '#/assets/scss/Carousel.scss';
<Carousel :wrap-around="true" class="box-carousel" :autoplay="2000" :transition="500">
<Slide v-for="slide in slides" :key="slide.id">
<div class="mx-auto w-[85%] md:w-[90%] rounded-lg p-5 bg-blue-secondary-5 h-full dark:bg-blue-secondary-5 dark:text-black-dark-100">
<!-- Box Description -->
<div class="grid grid-cols-5 gap-5 mb-5">
<div class="col-span-1">
<div class="rounded-full h-11 w-11 bg-black-20 flex items-center justify-center">
<p class="uppercase font-bold text-sm">{{slide.title}}</p>
</div>
</div>
<div class="col-span-4 text-left">
<div class="ml-3 md:ml-0">
<p class="font-bold">{{slide.name}}</p>
<p class="text-black-40 text-xs">{{slide.date}}</p>
</div>
</div>
</div>
<!-- End Box Description -->
<!-- Box Comment -->
<div class="text-left mb-8">
<p class="text-sm ">
{{slide.comment.substring(0,130)}}
</p>
</div>
<!-- End Box Comment -->
<!-- Box Actions -->
<div class="grid grid-cols-6 gap-5 absolute bottom-5">
<div class="col-span-2">
<a href="javascript:void(0)" class="flex items-center text-xs md:text-sm relative top-1 text-blue-secondary-100">
<UndoIcon width="10" class="fill-blue-secondary-100 mr-2 hidden md:block" />
Responder
</a>
</div>
<div class="col-span-2">
<a href="javascript:void(0)" class="flex items-center text-xs md:text-sm relative top-1 text-black-40 underline">
Ver contexto
</a>
</div>
<div class="col-span-2">
<p class="text-xs md:text-sm flex items-center justify-end md:justify-start relative top-1">
<span class="h-2 w-2 rounded-full bg-green-primary-100 inline-block mr-5 md:mr-1 relative top-[-1px]"></span>
<span class="hidden md:block">aprovado</span>
</p>
</div>
</div>
<!-- End Box Actions -->
</div>
</Slide>
<template #addons>
<Navigation />
</template>
</Carousel>
But the transition behavior of the slides is not as expected. It is just changing withouth the transition/translate position effect
This is how it is:
Expected effect: (by the way, the carousel sometimes spontaneously display the expected behavior like when after some hot module replacement refresh happens after saving some edit in VSCode and there is a refresh in the vue app like this):
Thanks in advance for any advice!! Happy new year !! 🙂
I am trying to create a homepage that has two columns, one with text and another with a carousel of images.On web view, the layout looks great, but on mobile view, the images are compressed leaving a lot of space around. I have tried setting the image height to full with h-full which doesn't work. How can i make the image occupy the full grid height on mobile view as well? Any recommendations / references will be appreciated.
My code :
<section className="p-9">
<div className="min-h-screen grid grid-cols-1 sm:grid-cols-2 md:grid-cols-8 lg:grid-cols-8 items-center pt-9">
<div className="col-span-2">
<p className="font-bold text-4xl mb-4 ml-4">
A construction <span className="text-red-600">ecosystem</span> that is
simple, transparent and <span className="text-red-600">efficient</span>
</p>
</div>
{/* <div className="h-full col-span-6">
<img className="w-full h-full m-2" src={carousel1} />
</div> */}
<div
id="carouselExampleCrossfade"
className="absolute carousel slide carousel-fade carousel-dark relative col-span-6 m-2"
data-bs-ride="carousel"
>
<div className="carousel-inner relative w-full h-full overflow-hidden">
<div className="carousel-item active float-left w-full bg-no-repeat bg-cover">
<img
src="https://www.shell.com/business-customers/construction-and-road/about-construction-and-road/_jcr_content/pagePromo/image.img.960.jpeg/1652883928742/two-engineers-working-on-a-construction-site.jpeg"
className="block w-full h-full rounded"
alt="Wild Landscape"
/>
<Link
href={`/service`}
className="absolute bottom-0 left-0 m-6 py-2.5 px-2.5 bg-red-600 text-white font-medium text-md leading-tight rounded hover:text-red-700 hover:bg-gray-100 focus:bg-none focus:outline-none focus:ring-0 active:bg-gray-200 transition duration-150 ease-in-out"
>
<span>{"Testing"}</span>
</Link>
</div>
</div>
</div>
</div>
</section>;
Link to code here
Current view on mobile:
Current view on web:
I am almost crazy..
I don't know why this code width layout is half only in my local machine.
I put this code
<div class="flex justify-center">
<div class="rounded-lg shadow-lg bg-white max-w-sm">
<a href="#!" data-mdb-ripple="true" data-mdb-ripple-color="light">
<img class="rounded-t-lg" src="https://mdbootstrap.com/img/new/standard/nature/182.jpg" alt=""/>
</a>
<div class="p-6">
<h5 class="text-gray-900 text-xl font-medium mb-2">Card title</h5>
<p class="text-gray-700 text-base mb-4">
Some quick example text to build on the card title and make up the bulk of the card's
content.
</p>
<button type="button" class=" inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out">Button</button>
</div>
</div>
</div>
in App.vue <template></template>
It looks ok with in pc mode
but in mobile mode, it looks different that I expected.
I don't have any idea. please help me.
I guess <div id=app></div> and <div class="flex .."> width should not be 900px.
It has to be like 375px.
I am not sure why it happens..
Please give me some solutions.
I missed viewport that's why it happens.
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Put this code in your head section, to fix the problem.
So I have created a website(deployed on Vercel) for practice and built it responsive by having breakpoints for different screen sizes. But now, when I see the same website's dashboard page on my mobile, I see some extra unwanted space in its right-top corner and in its index page's desktop view; the footer is, for some reason floating above the bottom of the screen. I have pictures below of desktop view of the footer and dashboard page as shown in Edge and as shown in Chrome Android.
I have built it using React and Tailwind CSS. My website's link is
Dashboard link - https://build2-eight.vercel.app/dashboard
Index Page - https://build2-eight.vercel.app/
And in my development server, neither of the issues were encountered.
The code is:-
/* Index.css custom tailwind classes */
#layer components{
.cardMainPage{
box-shadow:0px 0px 15px rgb(0,0,0,0.32);
#apply flex flex-col items-center justify-start text-2xl gap-5 p-2 py-3 rounded-md bg-white;
}
.Icons{
#apply bg-[#aff0cc] rounded-full h-16 md:h-8 w-16 md:w-8 flex flex-row justify-center items-center cursor-pointer hover:bg-white;
}
.HeaderIcons{
#apply bg-[#aff0cc] p-2 h-8 w-8 rounded-sm hover:bg-white cursor-pointer;
}
}
React Code : -
/* Footer React code */
import React from 'react';
export default function Footer() {
return (
<div className='bg-[#5cdb95] text-[#05386b] w-full text-md flex items-center justify-center'>
<div className='text-center'>
Made with <b className='text-red-600 text-lg'>♥</b> by <a href="/" className=' underline hover:no-underline'>Soumya Deep Sarkar</a>
</div>
</div>
)
}
Dashboard code->
/* Dashboard page code */
import React from "react";
import Header from "../header/index";
import Footer from "../footer/index";
import { GrBitcoin, GrGamepad } from "react-icons/gr";
import { SiCodingninjas } from "react-icons/si";
import { FiSearch } from "react-icons/fi";
import { FcSettings, FcBusinessman } from "react-icons/fc";
import { IoMdNotifications } from "react-icons/io";
import {GrChat} from "react-icons/gr"
export default function Dashboard() {
return (
<div className="flex flex-col h-screen">
<Header />
<div className="flex flex-row h-full">
<div
id="left-side-menu"
className="p-2 px-1 bg-back py-4 flex justify-between h-full flex-col"
>
<div className=" flex flex-col gap-3">
<span className="Icons">
<GrBitcoin />
</span>
<span className="Icons">
<GrGamepad />
</span>
<span className="Icons">
<SiCodingninjas />
</span>
</div>
<div className="flex flex-col gap-3">
<span className="Icons">
<FcSettings />
</span>
<span className="Icons">
<FcBusinessman/>
</span>
</div>
</div>
<div id="center-menu" className="flex flex-col w-full">
<div className="bg-[#20d876] w-full flex flex-row justify-between items-center px-4">
<span className="HeaderIcons my-1"><IoMdNotifications className="text-yellow-500"/></span>
<form className="w-full flex flex-row items-center justify-center p-1">
<span className="relative flex items-center">
<input type="text" className="border-2 px-2 rounded-md border-text "/>
<span className="absolute right-1 cursor-text"><FiSearch/></span>
</span>
</form>
<span className="HeaderIcons"><GrChat className="text-yellow-500"/></span>
<div>
</div>
</div>
</div>
<div id="right-side-menu"></div>
</div>
<Footer />
</div>
);
}
I have figured it out. The textbox(search one) is causing the issue in case of the dashboard header. To fix it I just have to define its width to 100% and it worked out.
Regarding the footer issue. I had to define the minimum height of the window. So I set min height to 100vh.
In tailwind css, for the dashboard header I just put w-full in the className attribute and for the footer I put min-h-screen in the parent div.
I am trying to make a website using NextJS and tailwindcss. But the div keeps shifting towards the left whenever the browser window is been resized.
Here is how it looks on resize but the text should be centered
Here is how it looks on desktop
import { IoIosArrowForward } from "react-icons/io";
import Link from "next/link";
const About = () => {
return (
<div className="font-inter py-4 my-16 flex justify-center items-center flex-col"
id="about">
<p className="text-6xl font-bold text-gray-700 text-center">
Hey, I'm Anurag
</p>
<p className="text-2xl text-gray-600 text-center my-8">
Hey there, I'm a Frontend Developer based in India. <br />
I'm mainly focused on Frontend Development, and I also write blogs
and design sometimes. <br />
Apart from coding, I love listening to music!
</p>
<p className="flex justify-center">
<Link href="https://github.com/kr-anurag" passHref>
<a className="text-xl w-72 text-white font-medium px-4 py-3 rounded-full flex items-center justify-center bg-gradient-to-r from-[#12c2e9] via-[#c471ed] to-[#f64f59] shadow-xl hover:bg-gradient-to-l duration-100"
aria-label="github-account"
target="blank">
Checkout my Github
<IoIosArrowForward />
</a>
</Link>
</p>
</div>
);
};
export default About;
By adding one tailwind class would solve the issue.
Add w-full to #about div. Here, is the sample of your code. Please check it out.
It works!