Skip to content
Discussion options

You must be logged in to vote

Hey @Mihai-github 👋

I hope you're enjoying Tailwind CSS so far!

When applying responsive variants, there must be no space between the variant and the utility class.

lg:text-center is correct, lg: text-center (with the space) is not.


from my testing the only way I've found is having everywhere you would like to use something different based on the window size that has been previously declared you must use the same "hack" like below:

<div className="text-left bg-gray-700  lg:text-center lg:bg-gray-500">
          <p style={{ color: "#fff" }}>salut</p>
</div>

This is not a hack, this is how Tailwind responsive classes work! You define styles for small screens, and can alter those styles a…

Replies: 3 comments 14 replies

Comment options

You must be logged in to vote
9 replies
@Mihai-github
Comment options

@simonswiss
Comment options

@Mihai-github
Comment options

@feapolina
Comment options

@realihorrud
Comment options

Answer selected by Mihai-github
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@RobinMalfait
Comment options

@StyxUA
Comment options

@StyxUA
Comment options

@RobinMalfait
Comment options

@StyxUA
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
8 participants