I would greatly appreciate it if you could provide instructions on how to connect this React component to a

Just starting out with html/css as a freshman and facing some challenges in my studies.

I'm trying to link my React file to my css file, but I'm struggling to figure it out despite researching all possible methods.

(1) React file

import styled, { keyframes } from "styled-components";

const Flow = () => {
    return (
        <Container>
         <FlowBox>
          <FlowWrap>
            <Flow>
              <span>King of pirates</span>
              <span>King of pirates</span>
              <span>King of pirates</span>
              <span>King of pirates</span>
            </Flow>
          </FlowWrap>
        </FlowBox>
        </Container>
    )
}
export default AboutFlow;

const Container = styled.div`
    margin:100px 0 0 0;
    border-top:1px solid #000;
    border-bottom: 1px solid #000;
`
const flowing = keyframes`
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
`

const FlowBox = styled.div`
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
`

const FlowWrap = styled.div`
    display: flex;
    top: 0;
    left: 0;
    align-items: center;
    width: 100%;
    height: 100%;
    white-space: nowrap;
`


const Flow = styled.div`
    font-size: clamp(15px, 10vw, 8rem);
    animation: ${flowing} 8s linear infinite;
    span{
        display:inline-block;
        font-weight:600;
        padding:0 20px;
    }

(2) My CSS file

@import "./react.css";
.title{
    background-image: url(../src/img/upper_blackbar_edit.png);
    min-width: 1000px;
    background-size:100% 50px;
}
.bg{
    width:100%;
    min-width: 1000px;
}
.logo{
    height:50px;
    vertical-align: top;
}
.map{
    min-width: 100%;
    width: 80%;
    object-fit: cover;
    display: block;
    top:10%;
    margin:auto;
}


.body{
    min-width: 1000px;
    background-image: url(../src/img/background.png);
    background-size:cover;
    overflow: scroll;
} 

Seeking help to properly link my css file with the React file. Any concrete suggestions would be greatly appreciated.

Looking for detailed steps on how to achieve this goal.

Answer №1

import '(insert your specific css file path here)';

    const PirateBox = () => {
        return (
            <Container className="(name your class)">
             <PirateChest className="(name your class)">
              <PirateMap className="(name your class)">
                <PirateShip>
                  <span className="(name your class)">King of pirates</span>
                  <span className="(name your class)">Queen of the seas</span>
                  <span className="(name your class)">Treasure Island adventures</span>
                  <span className="(name your class)">Ahoy, matey!</span>
                </PirateShip>
              </PirateMap>
            </PirateChest>
            </Container>
        )
    }

Don't forget to import the designated css file and use className accordingly to enjoy the pirate theme!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Refreshing the form fields and storing the information using AngularJS

I have successfully implemented a basic form using AngularJS. The issue I am facing is that even after the user enters their details and submits the form, the values remain in the input fields. My goal is to store the details of multiple fields in the con ...

The slideToggle function in jQuery seems to have trouble working on a Joomla platform, however, it functions perfectly on jsbin

I'm currently working on a website and I'm trying to implement the jQuery slideToggle feature to move some blocks. Everything seems to be working fine when I test the code on jsbin.com, but for some reason, it's not functioning properly on m ...

AppBar is concealed behind a Drawer cover in material-ui

How can I make my drawer component open underneath the AppBar Component instead of covering it in the new version of @Material-Ui/core? Does anyone have any ideas on how to achieve this? The current behavior is that the drawer covers the AppBar, but I wa ...

Ensure that the image remains positioned at the bottom of the page

Although it may seem like a repetitive question, the answers I have come across are quite unbelievable. Why would multiple lines of code be needed for such a simple task? It just doesn't make sense. I specifically want to ensure that the img is locat ...

Aligning cards vertically in a grid using Material-UI

I am attempting to vertically align some cards within the grid layout. Below is a snippet of my code. I have experimented with the following: Using align="center" and nesting the <Box m={1}> section inside another box with display="flex" align="cen ...

Using capital letters with interpolated language keys

The issue: I'm currently facing a problem with i18next. It allows variable interpolation in strings, like "AddNew": "Add new {{item}}". However, I have a language where the grammar requires "{{item}}" to be the first word, as in "AddNew": "{{item}} t ...

Is there a way to set the z-index independent of its parent element's stacking order?

Struggling with creating a Netflix logo using only pure CSS. I have a span element and its before pseudo-element. The issue is figuring out how to position .netflix span:nth-child(2) in front on the z-axis compared to .netflix span:nth-child(2):before. Is ...

Develop a server-rendered component using create-react-app

In my most recent project, I am thrilled about using create-react-app. However, I have encountered an issue that has left me unsure of the proper solution. I've successfully implemented Redux for state management in my app, and everything is function ...

One way to retrieve the step value from a slider using jQuery

I need to retrieve the step value of a slider using jQuery. While I can currently locate the step value in the HTML code, I would like to avoid having to update it manually across multiple files if it changes in the future. When I mention the step value, ...

Trouble encountered while setting up Firebase Auth for React Native by utilizing AsyncStorage

Trying to implement SMS authentication via Firebase has presented some challenges for me. Despite poring over the documentation and scouring Google for solutions, I've hit a dead end. My setup is pretty basic - just a single input field and a "Send" b ...

Customize the drawer background in Vue Material

Recently, I developed a vuejs application incorporating Google's material design components. I've been exploring options to customize the background color. <template> <div class="page-container"> <md-app> ...

Enhance the visibility of day borders on a Full Calendar featuring vertical Resources

In our current setup, we are utilizing FullCalendar in the week view format with vertical columns assigned to specific resources for each day. One challenge we are facing is distinguishing where each day begins and ends, as all cells have the same side bo ...

Post Request with Axios: Results stored in Config Data rather than Data field

I am currently following a MERN Stack Tutorial on YouTube to create a basic app, but I've encountered a frustrating problem. On the front end (React side), I'm using Axios to send a post request and store student data in a database. axios({ ...

How do I set the size of a background image in Vaadin

Recently, I've been working on styling a Vaadin project with CSS. Here's the code snippet I used: .image-background { background-image: url("../resources/bilder/wallpaper1.jpg"); However, the outcome didn't meet my expectations. Th ...

Combining the elements p and div on a single line

I've designed a card layout with 3 rows containing a paragraph and a div element each. I want both elements in each row to be displayed on the same line. How can I achieve this? Sample HTML: <div class="user_card"> <div class="skills"&g ...

Apply a CSS class to the selected radio button when retrieving row data from the table

How can I dynamically add a CSS class to a snippet of code when a radio button is selected? Here's the jQuery Snippet: $(document).ready(function (){ $("input:radio").click(function () { if ($(this).is(":checked")) { var empid ...

Show just three items simultaneously

I am currently working on a quote generator and I want to add a feature that allows me to display a specific number of quotes at a time. I attempted to use map for this purpose, but encountered an error stating it's not a function. Currently, the gene ...

HTML: Launch Frameset in a Separate Tab or Window

I have encountered an issue with using FRAMESET. Situation: Within my frameset, I have a menu with 5 links. When I click on the home page, everything looks fine. However, when I open it in a new tab or window, the design is not displayed. Is there a way ...

Ways to showcase various data on a single PHP page without relying on the GET method

I'm currently working on a project to create a website where users can set up their own profiles and share their profile link for others to view. Instead of having separate pages for each user, I want to streamline the process by using just one page t ...

Issue with bouncing dropdown menu

I am in the process of enhancing a Wordpress website by implementing a jQuery menu with sub-menus. Below is the jQuery code snippet: $(document).ready(function(){ $('.menu > li').hover(function(){ var position = $(this).position(); ...