Arranging text in a straight line using Flexbox

I've been trying to figure out the best way to align these two items. When you view the code snippet, you'll notice that 'Newsletter' is slightly lower than 'Resources'. Both are supposed to be aligned both vertically and horizontally, but for some reason, they're not on the same line.

* {
  margin: 0;
  padding: 0;
}


.footer {
  width: 100%;
  height: 150px;
  background-color: #6D7B8D;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: row;
}
 <footer>
   <div class="footer">

     <div class="col">
       <p class="coltitle">Resources</p>
       <ul class="footer-links">
         <li><a href="/">Link</a></li>
         <li><a href="/">Link</a></li>
         <li><a href="/">Link</a></li>
       </ul>
     </div>

     <div class="col">
       <p class="coltitle">Newletter</p>
       <ul class="footer-links">
         <li>
           <form action="#" method="post">
             <input type="email" name="email" placeholder="Subscribe" maxlength="80" required />
           </form>
         </li>
       </ul>
     </div>

   </div>
 </footer>

Answer №1

After removing the align-items: center and adding a margin-top to .col, can you confirm if it is working as expected for you?

 * {
      margin: 0;
      padding: 0;
    }


    .footer {
      width: 100%;
      height: 150px;
      background-color: #6D7B8D;
      display: flex;
      justify-content: space-evenly;
      flex-direction: row;
    }

    .col {
    margin-top: 30px;
    }
 <footer>
   <div class="footer">

     <div class="col">
       <p class="coltitle">Resources</p>
       <ul class="footer-links">
         <li><a href="/">Link</a></li>
         <li><a href="/">Link</a></li>
         <li><a href="/">Link</a></li>
       </ul>
     </div>

     <div class="col">
       <p class="coltitle">Newletter</p>
       <ul class="footer-links">
         <li>
           <form action="#" method="post">
             <input type="email" name="email" placeholder="Subscribe" maxlength="80" required />
           </form>
         </li>
       </ul>
     </div>

   </div>
 </footer>

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

Navigating a dynamic table by looping through its generated tr elements

I am currently working with a dynamically created tr table that includes individual rows of data and a fixed total sum at the bottom. The total sum does not change dynamically. var tmp = '<tr id="mytable"> <td id="warenid">'+data1.id ...

When you hover the cursor over it, the material-ui icon button shines with an elliptical background effect

There seems to be a strange issue with the IconButton in @material-ui/core/IconButton that is causing a weird elliptical background to appear when hovering over it. https://i.stack.imgur.com/Xof8H.png Even after copying the code directly from the materia ...

Can the height of one div be determined by the height of another div?

Here's the specific situation I am facing: I want the height of Div2 to adjust based on the content of Div3, and the height of Div3 to adapt based on the content in Div2. The height of Div1 is fixed at 500px. Some of the questions that arise are: I ...

Angular 12 experiencing CSS alignment issues

In my Angular component, I have the following CSS: .folders { border-left: 5px solid #b8744f; -moz-border-radius: 5px; -webkit-border-radius: 5px; -moz-box-shadow: inset 0 0 1px #fff; -webkit-box-shadow: inset 0 0 1px #fff; /*CORRECTION NEEDED ...

Retrieve a property from a designated element within the DOM

Is there a way to specifically extract the src attribute of the second image in an HTML file using PHP DOM parser? foreach($html->find('img[src]') as $element) $src = $element->getAttribute('src'); echo $src; I s ...

I must remove the thumb from the input range control

I am looking for a way to remove the thumb from the progress bar in my music player. I have tried various methods without success, and I simply want the progress bar to move forward with color change as it advances based on the Progress variable. For refe ...

Incorporate web control's stylesheet into page with UpdatePanel registration

What is the most effective way to register a stylesheet only once on a page using a custom web control? Keep in mind that the page utilizes an UpdatePanel for asynchronous calls. I attempted placing the <link> tag in ScriptManager.RegisterClientScrip ...

My goal is to have the "show more" button reveal extra information without having to reload the entire page

I’m trying to figure out how to make the “more” button show additional information without reloading the entire page. I’ve done some research online and found that AJAX can help with this, but since I’m just starting to learn JavaScript, I have n ...

Send HTML form data to a specific print page via POST method

I have a page VIEW-SALE.PHP that includes a submit button form to view the invoice in print format. Here is the code snippet: <span style='display:inline-block'> <form name='print' id='print' action='pr ...

Incorporating a URL into an HTML marquee

As a beginner in coding, I'm currently exploring how to incorporate a link into my marquee. My goal is to eliminate any color change or underline animation as well. Do you have any recommendations? .Marquee { color: #da6fe2; background-color: t ...

The radio button becomes unchecked when moving to the next fieldset

While developing a dynamic page using PHP and Laravel, I encountered a situation where I needed to add an additional radio button option to each card. Below is the code snippet for the card in question: <div class="card" style="margin:10p ...

Having trouble getting jQuery css() function to work properly?

<a href="https://www.timeatthebar.co.uk" target="_blank"><img id="icon-img" src="assets/img/tabicon2.png" class="position-absolute top-50 start-50 translate-middle" style="max-width:113px; top ...

Create a dynamic design with Angular Material's mat-drawer at full height using flexbox, allowing content

Yesterday, I encountered an interesting CSS problem involving the mat-drawer and Angular's router-outlet. My layout consists of a full-page flexbox with two children: a mat-toolbar at the top, and a custom component called app-sidenav at the bottom. T ...

What are the risks of using react + bootstrap without importing bootstrap.js?

When bootstrap library is used along with React, potential unpredictable behavior and difficult bugs may arise due to DOM modifications. Is it feasible to use bootstrap without including bootstrap.js? What are the drawbacks? While I am aware of the ' ...

How to line up text in HTML so that Unicode characters are aligned to the left and right within

Is there a way to align text on the left and right side of the same line? I experimented with various solutions for non-Unicode text that I found here. However, when it comes to Unicode text, the two parts of the text do not align vertically: https://i.s ...

Tips on how to lock the ag-grid to the highlighted row's position and force it to scroll

We have integrated ag-grid into our system, and I am facing an issue with displaying the scrollbar in a child window based on the selected row position in ag-grid. Please refer to the Plunkr link below and click on source_id which will lead you to an edit ...

What is the process for transferring input field values to PHP?

I am working on setting up a database and login form, and I need to create a PHP script to validate the login credentials. What are the different types of data access and how can they be utilized? Specifically, how do I retrieve user input from elements ...

What is the best way to dynamically shift the position of an image on a page while keeping it in place in real-time?

A group of friends and I are currently collaborating on an experimental project for a presentation. Our goal is to have multiple elements (such as images, text, gifs) displayed on a page that can be dragged around in real-time using a draggable script whi ...

Utilize SVG files as path elements

Currently, I am using webpack via CLI with a command like webpack --watch. My objective is to compile JavaScript with SASS and place it in a separate HTML page. Within my SASS, I have links to SVG files that look like this: label { background: url(.. ...

Unable to Display Bootstrap 4 Navbar on Hamburger Menu

I am having an issue with my mobile-sized site. Whenever I click the hamburger menu, the Navbar does not appear. I have double-checked and my data-target matches the nav id, so I am not sure why it is not working. <section id="nav"> <na ...