Elements within div not aligning in a single row

I am currently working on a React application where I need to align 2 links and a button in a row under a div. However, only the links are aligning in a row, not the form fields. Below is my code snippet:

<div className='header'>
  
    <a>Privacy policy</a>

    <a>Terms and conditions</a>
    
    <Form
      state={state}
      onClick={() => {
        setState(true);
        inputFocus.current.focus();
      }}
      onSubmit={onFormSubmit}
      ref={node}
    >
      <Button type="submit" state={state}>
        <FontAwesomeIcon icon={'search'} size="1x" />
      </Button>
      <Input
        onChange={e => setInput(e.target.value)}
        ref={inputFocus}
        value={input}
        state={state}
        placeholder="Search for a movie..."
      />
    </Form>
</div>

Here's my CSS:

.header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

Can anyone suggest how I can resolve this issue? Thank you!

Answer №1

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    height:100vh;
    margin: 0 auto;
}

Answer №2

.title-bar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    align-content:center;
}

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

Obtaining User's Geolocation without the need for an index.html file

Greetings! I am in the process of developing a web application that needs to track user location upon button click. My choice for this project is the M.E.R.N stack, and based on the tutorials I have watched so far, there seems to be no need for an index.ht ...

Tips for catching errors in Apollo Client while executing GraphQL queries

Here is my approach to querying data from a Graphql engine. export GraphQLWrap <TData, TParam = {}>({ query, extractData, children, queryVariables, skip, }: AsyncWrapProps<TData, TParam>) => { return ( <ApolloConsumer> ...

Custom Native Scrollbar

Currently, there are jQuery plugins available that can transform a system's default scroll bar to resemble the iOS scroll bar. Examples of such plugins include . However, the example code for these plugins typically requires a fixed height in order to ...

Utilizing the useContext hook to import a basic variable with ApolloClient

I am new to using react and I am having trouble importing a client variable from a context. In my file federation.tsx, I have the following code snippet that I believe is relevant: const link = createHttpLink({ uri: process.env.URL, }); const useApolloC ...

Include the component with the function getStaticProps loaded

I am currently working on a project using NextJs and I have created a component to load dynamic data. The component works fine when accessed via localhost:3000/faq, but I encounter an error when trying to import the same component into index.js. It seems l ...

Exploring the connected component feature in React/Redux

While testing the connected component of my React/Redux app, I encountered an error. The test case that caused the error is: App component › shows account info and debits and credits` Invariant Violation: Could not find "store" in either the context or ...

Issue with the Ajax auto-complete feature in Internet Explorer

I am facing an issue with my "ajax suggestion list" getting hidden behind the "select menu" located right below the text box that triggers the ajax function. This problem only occurs in IE 6.0, while it works fine in other browsers. I have already disabled ...

Tips for Building Common Controller Logic in CakePHP

I am in the process of developing a website where I have set up dynamic content for the footer, which is retrieved from a database. I am looking to create a single controller logic code that can be used across all pages on the site. Any suggestions or gu ...

What could be the reason for an ASP.NET Core application not loading within an iframe on the same domain?

I am facing an issue with my ASP.NET Core MVC website, which is embedded as the src of an IFRAME within a portal. Both the portal and the .NETCore application share the same domain (e.g., site.portal.domain / portal.domain). Upon entering the portal, I en ...

Does a DOM API exist specifically for querying comment nodes within the document?

My document contains a debugging comment that appears as follows: <!--SERVER_TRACE {...}--> Is there a method to search the DOM and access this specific node? I would prefer a vanilla JavaScript solution, without relying on any external libraries. ...

Run javascript code after the page has transitioned

Struggling to create a dynamic phonegap app with jQuery Mobile, the issue arises when loading JavaScript on transition to a new page. The structure of my index page is as follows: <body> <div data-role="page" id="homePage"> <div data- ...

How do I prevent my image slider from scrolling to the top of the page when I click next or prev?

<script> export default { name: "ImageSlider", data() { return { images: [ "https://cdn.pixabay.com/photo/2015/12/12/15/24/amsterdam-1089646_1280.jpg", "https://cdn.pixabay.com/photo/2016/02/17/2 ...

Incorporating logo image within navigation bar

Having an issue with displaying my logo within the navbar. The logo is saved locally in the public folder. I've attempted passing it as a prop and even linking directly to the path, but I can't get it to show up. import AppBar from '@mater ...

A beginner's guide to integrating AWS Textract with React/NextJS

Seeking assistance to clean up my code or get a nudge in the right direction. I believe I'm on the right track, but some help would be great. Currently utilizing this. Here's the snippet of my code. UPDATE: Error: err TypeError: input.filter i ...

Is there a way to combine multiple incoming WebRTC audio streams into one cohesive stream on a server?

I am currently working on developing an audio-conferencing application for the web that utilizes a WebSocket server to facilitate connections between users and enables streaming of audio. However, I am looking to enhance the system by transforming the serv ...

What is the best way to include an image link in an HTML page generated with golang?

I am a beginner in Go and web apps, and I am working on creating an app that retrieves menu items from a database and sends the item description along with a related picture link through an HTML page for a browser. The app will be running on a local networ ...

Browse through content without displaying the page title on the navigation bar and without the use of frames

When I sign into certain websites, I have noticed that the address displayed is often something like this: https://examplesite.com/access Even though all the links on the landing page are clickable and functional, their corresponding addresses never show ...

Best practices for displaying JSON in an HTML document

Struggling with implementing jQuery autocomplete in a form with a long list of names in a dropdown select tag. The current code is not functioning as expected. public function executeNew($r) { $this->getResponse()->setContentType('applicat ...

Contrasting the identical tag version of material-ui on GitHub versus the NPM repository

As I was examining the tarball for Material UI version 1.5.1, I noticed that there are actually two different tarballs available for this particular version. Upon comparing the same file from both tarballs, I discovered some discrepancies. One of the tarb ...

Utilization of CSS with the symbols of greater than and asterisk

I've been experimenting with Sequence.js and finding it really impressive. There's one line of code that I'm having trouble understanding: #sequence .seq-canvas > * {...} I discovered that the > symbol selects only direct descendant ...